How to logout & log in as different user?
Issue #20
resolved
Hi, thanks for the work
Scenario:
- UserA is logged in using LinkedIn
- hit
/anvard/logout
- user is redirected to /login with a 'logged out' flash message
- click the login with LinkedIn button
- UserA is automatically authenticated without requiring reauthorisation
How can UserB log in using LinkedIn?
UserA could go to their linked in settings and un-authorise the app, but that's obviously impractical :)
I've tried the 'anvard/logout' route and have also tried adding the following to my /logout route:
Route::get('/logout', function() {
$hybridAuth = App::make('hybridauth');
$hybridAuth->logoutAllProviders();
// this not working either :(
// if(Auth::check()) {
// Auth::user()->remember_token = NULL;
// }
Auth::logout();
Session::flush();
return Redirect::route('login')->with('success', 'You\'ve been Logged Out');
});
As you can see.. I'm just trying it all :)
Here's an issue I found at hybridauth: https://github.com/hybridauth/hybridauth/issues/220
Thanks in advance, Tim
Comments (3)
-
reporter -
reporter my mistake… i need to log out of my provider (linkedin, etc) to allow another user to log into my app.
-
reporter - changed status to resolved
- Log in to comment
I've put this over on SO, too: http://stackoverflow.com/questions/24297533/hybridauth-anvard-how-to-log-out-log-in-as-different-user I'll update the issue over there, as I reckon it will get more eyes…