Created
January 6, 2014 01:16
-
-
Save AfzalivE/8276549 to your computer and use it in GitHub Desktop.
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 | |
// Other methods go here | |
// Auth filter | |
Route::filter('auth', function() | |
{ | |
if (\League\OAuth2\Server\Util\Request::buildFromGlobals()->header('Authorization')) { | |
// TODO DOES NOT WORK!!! | |
return Route::filter('oauth', 'LucaDegasperi\OAuth2Server\Filters\OAuthFilter'); | |
} else { | |
if (Auth::guest()) return Redirect::guest('user/login'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment