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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -