Skip to content

Instantly share code, notes, and snippets.

@AfzalivE
Created January 6, 2014 01:16
Show Gist options
  • Save AfzalivE/8276549 to your computer and use it in GitHub Desktop.
Save AfzalivE/8276549 to your computer and use it in GitHub Desktop.
<?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