Skip to content

A free open source IT asset/license management system

Switch to using username as match for google login

snipee950cf42791d
diff --git a/app/Http/Controllers/GoogleAuthController.php b/app/Http/Controllers/GoogleAuthController.php
index 608ee8459c..600c4696c1 100644
--- a/app/Http/Controllers/GoogleAuthController.php
+++ b/app/Http/Controllers/GoogleAuthController.php
@@ -33,9 +33,9 @@ class GoogleAuthController extends Controller
{
try {
$socialUser = Socialite::driver('google')->user();
- \Log::debug('Social user found');
+ \Log::debug('Google user found');
} catch (InvalidStateException $exception) {
- \Log::debug('Social user found');
+ \Log::debug('Google user NOT found');
return redirect()->route('login')
->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) {