Add logout button to user panel

This commit is contained in:
Jeremy Zhang 2017-11-20 03:54:29 +00:00
parent a1ac184bc2
commit ef4ab4e83c
3 changed files with 9 additions and 0 deletions

View File

@ -55,6 +55,8 @@ def callback():
@user.route('/logout', methods=["GET"])
def logout():
redir = session.get("redirect", None)
if not redir:
redir = request.args.get("redirect", None)
session.clear()
if redir:
session['redirect'] = redir

View File

@ -684,6 +684,10 @@ p.mentioned span.chatmessage {
width: 302px;
}
#logout_btn {
background-color: red;
}
/* CSS Variables */
:root {
/*--<var>: <value>*/

View File

@ -161,6 +161,9 @@
</span>
</div>
</div>
<div class="row">
<a id="logout_btn" class="waves-effect waves-light btn right" href="{{ url_for('user.logout', redirect=request.url) }}"><i class="material-icons">exit_to_app</i></a>
</div>
</div>
</div>