From e007364139143a037fcd64b42ad35ce1630590fe Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Sun, 22 Feb 2015 12:15:31 +0100 Subject: Got basic HTTP authentication working --- src/routes.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/routes.php') diff --git a/src/routes.php b/src/routes.php index ac9bc31..1ac35ab 100644 --- a/src/routes.php +++ b/src/routes.php @@ -1,9 +1,14 @@ 'auth.basic', function(){ - return 'hello world'; + return 'hello world'; }]); -Route::api(['version' => 'v1'], function () { - Route::resource('bot', 'CamilStaps\BotleaguesApi\BotController'); - Route::resource('user', 'CamilStaps\BotleaguesApi\UserController'); -}); \ No newline at end of file +Route::api(['version' => 'v1', 'protected' => true, 'providers' => 'basic'], function () { + Route::resource('bot', 'CamilStaps\BotleaguesApi\BotController'); + Route::resource('user', 'CamilStaps\BotleaguesApi\UserController'); +}); + +Route::when('bot', 'botleaguesapi-http-auth'); +Route::when('bot/*', 'botleaguesapi-http-auth'); +Route::when('user', 'botleaguesapi-http-auth'); +Route::when('user/*', 'botleaguesapi-http-auth'); \ No newline at end of file -- cgit v1.2.3