diff --git a/api/src/Security/OAuth/GoogleAuthenticator.php b/api/src/Security/OAuth/GoogleAuthenticator.php index 163d34bea6..b03e8a72e2 100644 --- a/api/src/Security/OAuth/GoogleAuthenticator.php +++ b/api/src/Security/OAuth/GoogleAuthenticator.php @@ -67,6 +67,9 @@ public function authenticate(Request $request): Passport { $profile->surname = $googleUser->getLastName(); $user = new User(); $user->profile = $profile; + } + + if (in_array($user->state, [null, User::STATE_NONREGISTERED, User::STATE_REGISTERED])) { $user->state = User::STATE_ACTIVATED; } diff --git a/api/src/Security/OAuth/HitobitoAuthenticator.php b/api/src/Security/OAuth/HitobitoAuthenticator.php index 7bcf5c9da8..7b814e570e 100644 --- a/api/src/Security/OAuth/HitobitoAuthenticator.php +++ b/api/src/Security/OAuth/HitobitoAuthenticator.php @@ -74,6 +74,9 @@ public function authenticate(Request $request): Passport { $profile->nickname = $hitobitoUser->getNickName(); $user = new User(); $user->profile = $profile; + } + + if (in_array($user->state, [null, User::STATE_NONREGISTERED, User::STATE_REGISTERED])) { $user->state = User::STATE_ACTIVATED; }