Log user out if they open login/register pages
This commit is contained in:
parent
9d96de5c9c
commit
03a2cb2549
1 changed files with 4 additions and 0 deletions
|
@ -30,6 +30,8 @@ def login():
|
|||
status=login_attempt['status'],
|
||||
message=login_attempt['message'])
|
||||
elif request.method == 'GET':
|
||||
if 'username' in session.keys():
|
||||
return redirect(url_for('logout'))
|
||||
return render_template('login.html')
|
||||
|
||||
|
||||
|
@ -51,6 +53,8 @@ def register():
|
|||
status="danger",
|
||||
message="Passwords do not match!")
|
||||
elif request.method == 'GET':
|
||||
if 'username' in session.keys():
|
||||
return redirect(url_for('logout'))
|
||||
return render_template('register.html')
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue