mirror of
https://github.com/csd4ni3l/grass_touching_captcha.git
synced 2026-01-01 04:23:45 +01:00
fix logout not redirecting and make the unathorized redirect to login
This commit is contained in:
4
main.py
4
main.py
@@ -226,10 +226,10 @@ def info():
|
|||||||
@app.route('/logout')
|
@app.route('/logout')
|
||||||
def logout():
|
def logout():
|
||||||
flask_login.logout_user()
|
flask_login.logout_user()
|
||||||
return 'Logged out'
|
return redirect(url_for("/"))
|
||||||
|
|
||||||
@login_manager.unauthorized_handler
|
@login_manager.unauthorized_handler
|
||||||
def unauthorized_handler():
|
def unauthorized_handler():
|
||||||
return redirect("/login")
|
return redirect(url_for("login"))
|
||||||
|
|
||||||
app.run(port=os.environ.get("PORT"), host=os.environ.get("HOST", "0.0.0.0"))
|
app.run(port=os.environ.get("PORT"), host=os.environ.get("HOST", "0.0.0.0"))
|
||||||
Reference in New Issue
Block a user