Last active
January 2, 2016 04:59
-
-
Save djekl/8254209 to your computer and use it in GitHub Desktop.
This is what I fire before every request to check if the user is logged in, and if not then attempt via remember cookie, then fire the auth.login event if logged in.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
App::before(function($request) | |
{ | |
if (!Auth::check()) | |
{ | |
Auth::viaRemember(); | |
if (Auth::check()) | |
{ | |
Event::fire('auth.login', array(Auth::user())); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment