Switch to using username as match for google login

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2023-05-10 01:58:36 -07:00
parent 567a800c51
commit e950cf4279

View file

@ -33,9 +33,9 @@ class GoogleAuthController extends Controller
{ {
try { try {
$socialUser = Socialite::driver('google')->user(); $socialUser = Socialite::driver('google')->user();
\Log::debug('Social user found'); \Log::debug('Google user found');
} catch (InvalidStateException $exception) { } catch (InvalidStateException $exception) {
\Log::debug('Social user found'); \Log::debug('Google user NOT found');
return redirect()->route('login') return redirect()->route('login')
->withErrors( ->withErrors(
[ [
@ -47,7 +47,7 @@ class GoogleAuthController extends Controller
} }
$user = User::where('email', $socialUser->getEmail())->first(); $user = User::where('username', $socialUser->getEmail())->first();
if ($user) { if ($user) {