Skip to content

Commit

Permalink
Add logout route
Browse files Browse the repository at this point in the history
  • Loading branch information
fsoest committed May 1, 2024
1 parent 087b987 commit e6229b5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
3 changes: 1 addition & 2 deletions monitor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ def callback():

@app.route('/logout')
def logout():
print(session)
session.clear()
return redirect(url_for('main'))
return render_template('logout.html')

return app
13 changes: 13 additions & 0 deletions monitor/templates/logout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{% extends 'base.html' %}

{% block header %}
{% endblock %}

{% block content %}
<div class="container">
<div class="row">
<p>You have been logged out.</p> <br>
<a href="https://canistaffit.vatsim-germany.org">Return to Can I Staff It</a>
</div>
</div>
{% endblock %}
3 changes: 3 additions & 0 deletions monitor/templates/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,8 @@ <h3>Hi, {{ name }} 👋</h3>
</div>
{% endif %}
</div>
<div class="row">
<a href="https://canistaffit.vatsim-germany.org/logout" color="red">Logout</a>
</div>
</div>
{% endblock %}

0 comments on commit e6229b5

Please sign in to comment.