mirror of
https://github.com/simple-login/app.git
synced 2024-11-14 08:01:13 +01:00
b5aff490ef
* Store sesions in redis to prevent saving old cookies * Format * Rename sid to session_id * Logout session completely Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
17 lines
486 B
Python
17 lines
486 B
Python
from flask import redirect, url_for, flash, make_response
|
|
|
|
from app.auth.base import auth_bp
|
|
from app.config import SESSION_COOKIE_NAME
|
|
from app.session import logout_session
|
|
|
|
|
|
@auth_bp.route("/logout")
|
|
def logout():
|
|
logout_session()
|
|
flash("You are logged out", "success")
|
|
response = make_response(redirect(url_for("auth.login")))
|
|
response.delete_cookie(SESSION_COOKIE_NAME)
|
|
response.delete_cookie("mfa")
|
|
response.delete_cookie("dark-mode")
|
|
|
|
return response
|