app-MAIL-temp/app/internal/exit_sudo.py
Adrià Casajús c2bb6488e4
Allow to login with proton to enter sudo mode (#1141)
* Allow to login with proton to enter sudo mode

* Updated wording

* lint

* Only enabled if the user has the account linked

* Add exit-sudo route for tests

Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
2022-07-04 16:09:36 +02:00

11 lines
272 B
Python

from flask import session, redirect, url_for, flash
from app.internal.base import internal_bp
@internal_bp.route("/exit-sudo-mode")
def exit_sudo_mode():
session["sudo_time"] = 0
flash("Exited sudo mode", "info")
return redirect(url_for("dashboard.index"))