Skip to content
Snippets Groups Projects
Commit a49e8624 authored by Patrick Jentsch's avatar Patrick Jentsch
Browse files

Add redirect for login page if the user is already loged in.

parent 0de63e2b
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,8 @@ from ..models import User
@auth.route('/login', methods=['GET', 'POST'])
def login():
if current_user.is_authenticated:
return redirect(url_for('main.index'))
form = LoginForm()
if form.validate_on_submit():
user = User.query.filter_by(email=form.login.data).first()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment