python - Skip Login Page if Session Exists -
how skip login page if active session exists in flask application.
currently have flask application, after successful login, redirecting page index -
http://example.com/ --> post login --> http://example.com/index (sucess)
however, when active session exists, , when try http://example.com/ , takes me login page again.
in login handler, check if user logged in in function. example, if you're using flask-login:
def login(): if current_user.is_authenticated(): return redirect(url_for('index')) # process login anon user
Comments
Post a Comment