forked from forks/microblog.pub
Enable Flask permanent session for the admin sessions
This commit is contained in:
parent
ce6a253178
commit
7a41c14167
1 changed files with 2 additions and 0 deletions
|
@ -90,6 +90,7 @@ def admin_login() -> _Response:
|
||||||
pwd = request.form.get("pass")
|
pwd = request.form.get("pass")
|
||||||
if pwd:
|
if pwd:
|
||||||
if verify_pass(pwd):
|
if verify_pass(pwd):
|
||||||
|
session.permanent = True
|
||||||
session["logged_in"] = True
|
session["logged_in"] = True
|
||||||
return redirect(
|
return redirect(
|
||||||
request.args.get("redirect") or url_for("admin.admin_notifications")
|
request.args.get("redirect") or url_for("admin.admin_notifications")
|
||||||
|
@ -108,6 +109,7 @@ def admin_login() -> _Response:
|
||||||
finally:
|
finally:
|
||||||
session["challenge"] = None
|
session["challenge"] = None
|
||||||
|
|
||||||
|
session.permanent = True
|
||||||
session["logged_in"] = True
|
session["logged_in"] = True
|
||||||
return redirect(
|
return redirect(
|
||||||
request.args.get("redirect") or url_for("admin.admin_notifications")
|
request.args.get("redirect") or url_for("admin.admin_notifications")
|
||||||
|
|
Loading…
Reference in a new issue