impl fix for user role
This commit is contained in:
@@ -189,6 +189,7 @@ class AuthController extends AbstractController
|
||||
new OA\Property(property: 'id', type: 'integer'),
|
||||
new OA\Property(property: 'username', type: 'string'),
|
||||
new OA\Property(property: 'email', type: 'string'),
|
||||
new OA\Property(property: 'role', type: 'string', example: 'administrator'),
|
||||
], type: 'object'),
|
||||
], type: 'object'),
|
||||
])
|
||||
@@ -254,6 +255,8 @@ class AuthController extends AbstractController
|
||||
$user->refresh_token_expires_at = Carbon::now()->addDays(30);
|
||||
$user->save();
|
||||
|
||||
$user->load('role');
|
||||
|
||||
OperationLogService::log(
|
||||
user_id: $user->id,
|
||||
action: 'auth.login',
|
||||
@@ -275,6 +278,7 @@ class AuthController extends AbstractController
|
||||
'id' => $user->id,
|
||||
'username' => $user->username,
|
||||
'email' => $user->email,
|
||||
'role' => $user->role?->name ?? 'accessor',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user