add logout button to admin panel
This commit is contained in:
parent
6a78cca00b
commit
a778756f3c
@ -19,6 +19,11 @@ def auth():
|
|||||||
else:
|
else:
|
||||||
return flask.redirect("/admin/auth?failed=1")
|
return flask.redirect("/admin/auth?failed=1")
|
||||||
|
|
||||||
|
@routes_api_admin.route("/logout", methods=["GET", "POST"])
|
||||||
|
def logout():
|
||||||
|
flask.session.pop("admin", None)
|
||||||
|
return flask.redirect("/")
|
||||||
|
|
||||||
@routes_api_admin.route("/setQuestions", methods=["GET", "POST"])
|
@routes_api_admin.route("/setQuestions", methods=["GET", "POST"])
|
||||||
@require_admin(api=True)
|
@require_admin(api=True)
|
||||||
def set_questions():
|
def set_questions():
|
||||||
@ -170,4 +175,4 @@ def delete_npc():
|
|||||||
input_npc_id = flask.request.json["npc_id"]
|
input_npc_id = flask.request.json["npc_id"]
|
||||||
db.session.execute(delete(Npc).where(Npc.NPC_ID==input_npc_id))
|
db.session.execute(delete(Npc).where(Npc.NPC_ID==input_npc_id))
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
return {}
|
return {}
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
{%endfor%}
|
{%endfor%}
|
||||||
<br>
|
<br>
|
||||||
<a href="/admin/npc/new"> Nouveau NPC </a>
|
<a href="/admin/npc/new"> Nouveau NPC </a>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<a href="/api/v1/admin/logout"> Logout </a>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
Reference in New Issue
Block a user