diff options
author | Camil Staps | 2016-09-04 23:30:15 +0200 |
---|---|---|
committer | Camil Staps | 2016-09-04 23:30:15 +0200 |
commit | c61b156f1bd93ec4aadd8adc78523b42b0232918 (patch) | |
tree | cd9bcb6f889dcf554818246957bed54eb14c9fbe /app/Http/routes.php | |
parent | Use blade templates (diff) |
User creation and authentication
Diffstat (limited to 'app/Http/routes.php')
-rw-r--r-- | app/Http/routes.php | 56 |
1 files changed, 36 insertions, 20 deletions
diff --git a/app/Http/routes.php b/app/Http/routes.php index 67b661b..9cf12b4 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -28,24 +28,40 @@ | */ -$app->group(['prefix' => parse_url(env('APP_URL'), PHP_URL_PATH)], function ($app) { - - $app->get('/', function () use ($app) { - return view('trainer'); - }); - - $app->get('/stem', function () use ($app) { - return \HebrewParseTrainer\Stem::all(); - }); - - $app->get('/tense', function () use ($app) { - return \HebrewParseTrainer\Tense::all(); - }); - - $app->get('/verb/random', 'App\Http\Controllers\RandomVerbController@show'); - - $app->get('/stats', function () use ($app) { - return view('stats'); - }); - +$app->group( + ['prefix' => parse_url(env('APP_URL'), PHP_URL_PATH)], + function ($app) { + + $app->get('/', function () use ($app) { + return view('trainer'); + }); + + $app->get('/stem', function () use ($app) { + return \HebrewParseTrainer\Stem::all(); + }); + + $app->get('/tense', function () use ($app) { + return \HebrewParseTrainer\Tense::all(); + }); + + $app->get('/logout', function () use ($app) { + return response('Unauthorized.', 401) + ->header('WWW-Authenticate', 'Basic realm="Please click OK, then Cancel to logout."'); + }); + + $app->get('/verb/random', 'App\Http\Controllers\RandomVerbController@show'); + + $app->get('/user/create', 'App\Http\Controllers\UserController@createForm'); + $app->post('/user/create', 'App\Http\Controllers\UserController@createForm'); + + $app->group( + ['middleware' => 'auth:basic-http'], + function ($app) { + + $app->get('/stats', function () use ($app) { + return view('stats'); + }); + + }); + }); |