mirror of
https://github.com/simple-login/app.git
synced 2024-11-16 00:48:32 +01:00
17 lines
480 B
Python
17 lines
480 B
Python
from flask import redirect, url_for, flash, make_response
|
|
from flask_login import logout_user
|
|
|
|
from app.auth.base import auth_bp
|
|
from app.config import SESSION_COOKIE_NAME
|
|
|
|
|
|
@auth_bp.route("/logout")
|
|
def logout():
|
|
logout_user()
|
|
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
|