Created
June 13, 2013 16:37
-
-
Save julien-c/5775253 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 | |
Route::post('oauth/token', function() { | |
$oauth = new OAuth2\Provider(); | |
return $oauth->tokenRequest(); | |
}); | |
Route::filter('oauth', function() { | |
$oauth = new OAuth2\Provider(); | |
return $oauth->filter(); | |
}); | |
Route::filter('optionalAuth', function() { | |
$oauth = new OAuth2\Provider(); | |
$oauth->verifyAccess(); | |
}); | |
Route::group(array('before' => 'oauth'), function() { | |
Route::get('private', function() { | |
return Response::json(['private' => 'stuff']); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment