Adapting existing routes
Posted: 25 Nov 2015, 17:45
Trying to secure the /admin routes. Not working at all.
Here's what I've tried:
Attempt #1: Put this in App\Http\routes.php:
Guest still allowed to /admin
Attempt #2: put this in App\Http\routes.php:
Guest still allowed to /admin
Attempt #3: changed vendor\aimeos-laravel\src\routes.php to read:
Guest still allowed access to /admin
Attempts #4/5/6: repeated all of the above but changed the controller name to MyController (which doesn't exist and should have broken something):
example:
/admin still works AND Guest still allowed to /admin
Just to be sure, after each of the above changes, ran php artisan aimeos:cache and php artisan clear-compiled
I should at least be able to get the login page to display if accessing as guest?
Here's what I've tried:
Attempt #1: Put this in App\Http\routes.php:
Code: Select all
Route::get('admin', array(
'as' => 'aimeos_shop_admin',
'middleware' => 'auth',
'uses' => 'Aimeos\Shop\Controller\AdminController@indexAction',
));
Route::get('admin/do', array(
'as' => 'aimeos_shop_admin_json',
'middleware'=> 'auth',
'uses' => 'Aimeos\Shop\Controller\AdminController@doAction'
));
Route::get('admin/file', array(
'as' => 'aimeos_shop_admin_file',
'middleware' => 'auth',
'uses' => 'Aimeos\Shop\Controller\AdminController@fileAction'
));
Attempt #2: put this in App\Http\routes.php:
Code: Select all
Route::group(config('shop.routes.admin', ['middleware'=>'auth']), function() {
Route::match( array( 'GET' ), 'admin/file', array(
'as' => 'aimeos_shop_admin_file',
'uses' => 'Aimeos\Shop\Controller\AdminController@fileAction'
));
Route::match( array( 'POST' ), 'admin/do', array(
'as' => 'aimeos_shop_admin_json',
'uses' => 'Aimeos\Shop\Controller\AdminController@doAction'
));
Route::match( array( 'GET' ), 'admin', array(
'as' => 'aimeos_shop_admin',
'uses' => 'Aimeos\Shop\Controller\AdminController@indexAction'
));
});
Attempt #3: changed vendor\aimeos-laravel\src\routes.php to read:
Code: Select all
Route::group(config('shop.routes.admin', ['middleware' => 'auth']), function() {
Route::match( array( 'GET' ), 'admin/file', array(
'as' => 'aimeos_shop_admin_file',
'uses' => 'Aimeos\Shop\Controller\AdminController@fileAction'
));
Route::match( array( 'POST' ), 'admin/do', array(
'as' => 'aimeos_shop_admin_json',
'uses' => 'Aimeos\Shop\Controller\AdminController@doAction'
));
Route::match( array( 'GET' ), 'admin', array(
'as' => 'aimeos_shop_admin',
'uses' => 'Aimeos\Shop\Controller\AdminController@indexAction'
));
});
Attempts #4/5/6: repeated all of the above but changed the controller name to MyController (which doesn't exist and should have broken something):
example:
Code: Select all
Route::group(config('shop.routes.admin', ['middleware' => 'auth']), function() {
Route::match( array( 'GET' ), 'admin/file', array(
'as' => 'aimeos_shop_admin_file',
'uses' => 'MyController@fileAction'
));
Route::match( array( 'POST' ), 'admin/do', array(
'as' => 'aimeos_shop_admin_json',
'uses' => 'MyController@doAction'
));
Route::match( array( 'GET' ), 'admin', array(
'as' => 'aimeos_shop_admin',
'uses' => 'MyController@indexAction'
));
});
Just to be sure, after each of the above changes, ran php artisan aimeos:cache and php artisan clear-compiled
I should at least be able to get the login page to display if accessing as guest?