From 18ec3e2c3dd58d4a6cdab83508b960345a96502b Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 28 Sep 2021 14:10:02 +0800 Subject: [PATCH] protect user routes with valid token middleware --- routes/account.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/routes/account.php b/routes/account.php index 5b4d45f9..2da67709 100644 --- a/routes/account.php +++ b/routes/account.php @@ -10,6 +10,14 @@ Route::group(['prefix' => 'account', 'namespace' => 'Accounts', 'as' => 'account Route::group(['middleware' => 'valid.token'], function () { Route::get('/logout', 'UserAuthenticationLogoutController@logout')->name('logout'); Route::get('/refresh', 'RefreshAuthenticationTokenController@refresh')->name('refresh'); + Route::group(['prefix' => 'user', 'as' => 'user.'], function () { + Route::post('/show', 'FetchUserController@fetch')->name('show'); + Route::get('/list', 'ListUsersController@list')->name('list'); + Route::put('/update/{id}', 'UpdateUserController@update')->name('update'); + + Route::post('/admin/create', 'CreateAdminUserController@create')->name('admin.create'); + Route::delete('/delete/{id}', 'DeleteUserController@delete')->name('delete'); + }); }); Route::group(['prefix' => 'login', 'as' => 'authenticate.'], function () { @@ -34,12 +42,5 @@ Route::group(['prefix' => 'account', 'namespace' => 'Accounts', 'as' => 'account }); - Route::group(['prefix' => 'user', 'as' => 'user.'], function () { - Route::post('/show', 'FetchUserController@fetch')->name('show'); - Route::get('/list', 'ListUsersController@list')->name('list'); - Route::put('/update/{id}', 'UpdateUserController@update')->name('update'); - - Route::post('/admin/create', 'CreateAdminUserController@create')->name('admin.create'); - Route::delete('/delete/{id}', 'DeleteUserController@delete')->name('delete'); - }); + }); \ No newline at end of file