79080301

Date: 2024-10-12 06:26:01
Score: 4
Natty: 4
Report link

I have same problem Before i know the problem, my code like this.

$user = Socialite::driver($provider)->stateless()->user();
$existingUser = User::where('email', $user->email)->first();

on my history error happen in method user() after stateless() the problem happen when user click button cancel in sign in to process on page login with google. As we know, after you choose your email will redirect you to choose new page with option Cancel | Continue

so we apply try catch like this

try {
  $user = Socialite::driver($provider)->stateless()->user();
} catch (\Exception $e) {
  return redirect()->to('https://blablabla.id/login');
}

and it solved. So, thank you sir. I hope my description for this issue make help someone.

Reasons:
  • Blacklisted phrase (0.5): thank you
  • Blacklisted phrase (1): I have same problem
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Me too answer (2.5): I have same problem
  • Low reputation (1):
Posted by: Muhammad Khoirul Yahya