I recently implemented Laravel Socialite
so that users can login using their Google+ accounts. Everything seems to be working but one issue I'm having is that after I login for the first time in a browser I am unable to switch to a different Google account if I log out and then log back in. Once the following code is executed in the LoginController it automatically (all in one action) logs me in with my Google account and redirects me back to my site without giving me the option to choose a different Google account.
public function redirectToProvider()
{
return Socialite::driver('google')->redirect();
}
Is there a way to force the user to explicitly choose which account they wish to login with every time?
A parameter "select_account" should be added to prompt for choosing the account before login. in your case it can be like below:
public function redirectToProvider()
{
return Socialite::driver('google')->with(["prompt" => "select_account"])->redirect();
}
This worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With