Added redirect on 401 Unauthorized

parent f2e0be83
......@@ -13,6 +13,10 @@ def load_user(userid):
return User.query.filter_by(id=userid).first()
@app.errorhandler(401)
def custom_401(_):
return redirect(url_for('login'))
@app.route('/login')
def login():
return zeus_login()
......@@ -23,4 +27,4 @@ def logout():
if 'zeus_token' in session:
session.pop('zeus_token', None)
logout_user()
return redirect(url_for('all_users'))
\ No newline at end of file
return redirect(url_for('all_users'))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment