My AuthController
's redirectTo
property:
protected $redirectTo = '/';
Here is login routes:
Route::get('auth/login', 'Auth\AuthController@getLogin');
Route::post('auth/login', 'Auth\AuthController@postLogin');
Route::get('/admin', [
'as' => 'admin',
'uses' => 'Auth\AuthController@getLogin'
]);
Route::post('/admin', [
'as' => 'admin',
'uses' => 'Auth\AuthController@postLogin'
]);
When I first log in, it redirects me to localhost:8000
as supposed, but if I try to get localhost:8000/admin
(which is login page) it redirects me to localhost:8000/home
page.
I know that it's possible to redirect from /home
, but I wonder why this happens?
Take a look at the \app\Http\Middleware\RedirectIfAuthenticated.php
.
Check this is middleware redirect after logging in.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community