Support the ongoing development of Laravel.io →
Authentication Session

Hi,

in my application i installed the laravel authentication controllers and routes via artisan make:auth.

In the LoginController i changed the redirectTo property from '/home' to '/', which is my dashboard. That works great and after the user logged in successfully, it's being redirected to the dashboard.

But if a user is already logged in and tries to revisit the '/login' route, laravel redirects to '/home', which does not exist.

How can i change the redirect path for '/login' on already logged in users?

Thanks Chris

Last updated 3 years ago.
0

Sorry guys, i just found the file to change that behavior: The 'RedirectIfAuthenticated' Middleware. :D

File: /app/Http/Middleware/RedirectIfAuthenticated.php Line: 21

return redirect('/home');
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.