vmangos
This commit is contained in:
@@ -5,29 +5,29 @@ namespace App\Http\Controllers\Api;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\LoginRequest;
|
||||
use App\Models\GameAccount;
|
||||
use App\Services\AzerothCoreAccountService;
|
||||
use App\Services\VMangosAccountService;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use OpenApi\Attributes as OA;
|
||||
|
||||
class LauncherAuthController extends Controller
|
||||
{
|
||||
public function __construct(
|
||||
private readonly AzerothCoreAccountService $accounts,
|
||||
private readonly VMangosAccountService $accounts,
|
||||
) {
|
||||
}
|
||||
|
||||
#[OA\Post(
|
||||
path: '/api/launcher/login',
|
||||
summary: 'Авторизация лаунчера',
|
||||
description: 'Авторизация по логину и паролю игрового аккаунта. Возвращает Bearer-токен для доступа к API.',
|
||||
description: 'Авторизация по логину и паролю сайта. Возвращает Bearer-токен для доступа к API и выдачи игрового билета.',
|
||||
tags: ['Launcher Auth'],
|
||||
requestBody: new OA\RequestBody(
|
||||
required: true,
|
||||
content: new OA\JsonContent(
|
||||
required: ['username', 'password'],
|
||||
properties: [
|
||||
new OA\Property(property: 'username', type: 'string', minLength: 3, maxLength: 32, pattern: '^[A-Za-z0-9]+$', example: 'Player'),
|
||||
new OA\Property(property: 'password', type: 'string', minLength: 3, maxLength: 32, example: 'secret123'),
|
||||
new OA\Property(property: 'username', type: 'string', minLength: 3, maxLength: 16, pattern: '^[A-Za-z0-9]+$', example: 'Player'),
|
||||
new OA\Property(property: 'password', type: 'string', minLength: 3, maxLength: 16, example: 'secret123'),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -75,7 +75,7 @@ class LauncherAuthController extends Controller
|
||||
], 401);
|
||||
}
|
||||
|
||||
$gameAccount = GameAccount::on('azerothcore_auth')->findOrFail($user->id);
|
||||
$gameAccount = GameAccount::on('vmangos_auth')->findOrFail($user->id);
|
||||
$token = $gameAccount->createToken('launcher');
|
||||
|
||||
return response()->json([
|
||||
|
||||
Reference in New Issue
Block a user