Social Logout

Again about the Laravel application involving Google login: it is often used on computers shared among many people, and logging on Google involves that all of the services are then enabled and accessible from that computers. Mostly undesiderable, of course.

Socialite logout do not implies Google logout, nor any form of OAuth logout. So I had to provide a trick.

The new logout() function looks as:

public function logout()
{
  Auth::logout();
  $url = sprintf('https://www.google.com/accounts/Logout?continue=https://appengine.google.com/_ah/logout?continue=%s', route('login'));
  return redirect($url);
}

When the user logs out, it is manually redirected on the proper URL to automatically logout from Google and then again on the login screen.

Probably not the best solution, as that global logout URL may change in future; it is a shame that OAuth does not provide tools for temporary login.