diff --git a/app/Http/Controllers/OauthController.php b/app/Http/Controllers/OauthController.php index ce373f0e..4b82e8d7 100644 --- a/app/Http/Controllers/OauthController.php +++ b/app/Http/Controllers/OauthController.php @@ -100,7 +100,11 @@ class OauthController extends Controller ->first(); if ($socialAccount) { //already bind, login directly + /** + * @var User $authUser + */ $authUser = $socialAccount->user; + $authUser->checkIsNormal(); logincookie($authUser->id, $authUser->auth_key); return redirect($homeUrl); } diff --git a/app/Repositories/UserRepository.php b/app/Repositories/UserRepository.php index 98a6df22..74860cb4 100644 --- a/app/Repositories/UserRepository.php +++ b/app/Repositories/UserRepository.php @@ -1,6 +1,7 @@ first()); + fire_event(ModelEventEnum::USER_DELETED, $users->first()); } return true; } diff --git a/include/globalfunctions.php b/include/globalfunctions.php index 11ea5b97..135f6194 100644 --- a/include/globalfunctions.php +++ b/include/globalfunctions.php @@ -1422,12 +1422,7 @@ function get_user_from_cookie(array $cookie, $isArray = true): array|\App\Models do_log("$log, user not exists"); return null; } - try { - $row->checkIsNormal(); - } catch (\Exception $e) { - do_log("$log, " . $e->getMessage()); - return null; - } + $row->checkIsNormal(); $authKey = $row->auth_key; } $expectedSignature = hash_hmac('sha256', $tokenJson, $authKey);