Problem
Visiting /auth/login while already authenticated still renders the login form instead of redirecting the user away. This is confusing and lets users re-submit credentials for no reason.
Expected behavior
If the current user is already authenticated, /auth/login should redirect to the home page (search.index).
Suggested fix
At the top of the login view in app/auth/controllers.py, check current_user.is_authenticated and redirect to url_for('search.index') before rendering the form.
The same check should probably apply to /auth/signup for consistency.
Problem
Visiting
/auth/loginwhile already authenticated still renders the login form instead of redirecting the user away. This is confusing and lets users re-submit credentials for no reason.Expected behavior
If the current user is already authenticated,
/auth/loginshould redirect to the home page (search.index).Suggested fix
At the top of the
loginview inapp/auth/controllers.py, checkcurrent_user.is_authenticatedand redirect tourl_for('search.index')before rendering the form.The same check should probably apply to
/auth/signupfor consistency.