I am using a third party authentication mechanism to authenticate users.
On successful authentication, I am able to redirect the users to the front page using the
RedirectResponse class. If logged-in users visit the URL, they get an access denied error.
I have built a custom module and the route for the login is /login. I want /user/login to function normally as it did initially. Logged-in users who reach /login must be redirected to the front page, instead of getting an access denied.
I want to achieve this without touching the .htacess file.
How can I achieve it?