+4 days ago I implemented the registration and login through Google in my Laravel application.
When the user does not have an account then it is created, but when it is already registered what it does is allow access.
public function handleProviderGoogleCallback()
{
$auth_user = Socialite::driver('google')->stateless()->user();
$user = User::firstOrCreate(
[
'email' => $auth_user->email
],
[
'refresh_token' => $auth_user->refreshToken,
'name' => $auth_user->name
]
);
Auth::login($user);
return redirect()->to('/home')->with('info', "Bienvenido " . $user->name); //
}
So far so good, the problem is when I will access the route to see my files. Since I get this error.
I did everything following this tutorial: link
I have tried to speak with the author, but it is not possible for me to respond.
I appreciate the guidance. Thank you very much