From 2c271ca4a162fde645b8c926446f11d600a6953c Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Mon, 13 May 2024 14:07:25 +0100 Subject: [PATCH] Revert "chore: cleanup" This reverts commit 9182e8f6a37098ff220cfe75cb27f4097783b936. --- app/controllers/api/account.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 96fed2d79d..b60ce6a04f 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -1291,7 +1291,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') throw new Exception(Exception::USER_UNAUTHORIZED, 'OAuth provider failed to return email.'); } - $isEmailVerified = $oauth2->isEmailVerified($accessToken); + $isVerified = $oauth2->isEmailVerified($accessToken); $userWithEmail = $dbForProject->findOne('users', [ Query::equal('email', [$email]), @@ -1341,8 +1341,8 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') Permission::delete(Role::user($userId)), ], 'email' => $email, - 'emailVerification' => $isEmailVerified, - 'status' => true, + 'emailVerification' => $isVerified, + 'status' => true, // Email should already be authenticated by OAuth2 provider 'password' => null, 'hash' => Auth::DEFAULT_ALGO, 'hashOptions' => Auth::DEFAULT_ALGO_OPTIONS,