[api] authenticate check is normal

This commit is contained in:
xiaomlove
2022-02-21 23:20:25 +08:00
parent 4d82f5cffa
commit e9d6aac31a
3 changed files with 4 additions and 3 deletions
@@ -19,6 +19,7 @@ class AuthenticateRepository extends BaseRepository
if (IS_PLATFORM_ADMIN && !$user->canAccessAdmin()) {
throw new UnauthorizedException('Unauthorized!');
}
$user->checkIsNormal();
$tokenName = __METHOD__ . __LINE__;
$token = DB::transaction(function () use ($user, $tokenName) {
$user->tokens()->delete();