2020-05-22 16:14:52 +02:00
|
|
|
from flask import redirect, url_for, flash, make_response
|
2019-07-01 17:18:12 +02:00
|
|
|
from flask_login import logout_user
|
|
|
|
|
|
|
|
from app.auth.base import auth_bp
|
2020-06-28 21:17:18 +02:00
|
|
|
from app.config import SESSION_COOKIE_NAME
|
2019-07-01 17:18:12 +02:00
|
|
|
|
|
|
|
|
|
|
|
@auth_bp.route("/logout")
|
|
|
|
def logout():
|
|
|
|
logout_user()
|
2020-04-27 22:56:44 +02:00
|
|
|
flash("You are logged out", "success")
|
2020-05-22 16:14:52 +02:00
|
|
|
response = make_response(redirect(url_for("auth.login")))
|
2020-06-28 21:17:18 +02:00
|
|
|
response.delete_cookie(SESSION_COOKIE_NAME)
|
2020-05-22 16:14:52 +02:00
|
|
|
response.delete_cookie("mfa")
|
|
|
|
response.delete_cookie("dark-mode")
|
|
|
|
|
|
|
|
return response
|