Skip to content

Commit

Permalink
Add Logout button to page
Browse files Browse the repository at this point in the history
  • Loading branch information
ThaLeprechaun committed Sep 8, 2019
1 parent 5e7e2ca commit 2f60c95
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
Binary file modified __pycache__/application.cpython-36.pyc
Binary file not shown.
8 changes: 7 additions & 1 deletion application.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,10 @@ def transactions():
@app.route("/faq", methods=["GET", "POST"])
def faq():
if request.method == "GET":
return render_template("faq.html")
return render_template("faq.html")

@app.route("/logout")
@login_required
def logout():
session.clear()
return redirect("/")
3 changes: 1 addition & 2 deletions templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
<li class="nav-item top-space nav-spacing"><a class="nav-link txt-color" href="/#about">About</a></li>
<li class="nav-item top-space nav-spacing"><a class="nav-link txt-color" href="/#contact">Contact</a></li>
<li class="nav-item top-space nav-spacing"><a class="nav-link txt-color" href="/faq">FAQ</a></li>
<li class="nav-item top-space nav-spacing"><a class="nav-link txt-color" href="/login">Login</a></li>
<li class="nav-item nav-spacing"><a class="nav-link txt-color" href="/register"><button type="button" class="btn btn-outline-primary btn-color">Register</button></a></li>
<li class="nav-item top-space nav-spacing"><a class="nav-link txt-color" href="/">Log Out</a></li>
</ul>
</div>
</div>
Expand Down
7 changes: 2 additions & 5 deletions templates/save.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,8 @@
<ul class="navbar-nav ml-auto">
<li class="nav-item top-space nav-spacing"><a class="nav-link txt-color" href="/#about">About</a></li>
<li class="nav-item top-space nav-spacing"><a class="nav-link txt-color" href="/#contact">Contact</a></li>
<li class="nav-item top-space nav-spacing"><a class="nav-link txt-color" href="/faq">FAQ</a>
</li>
<li class="nav-item top-space nav-spacing"><a class="nav-link txt-color" href="/login">Login</a>
</li>
<li class="nav-item nav-spacing"><a class="nav-link txt-color" href="/register"><button type="button" class="btn btn-outline-primary btn-color">Register</button></a></li>
<li class="nav-item top-space nav-spacing"><a class="nav-link txt-color" href="/faq">FAQ</a></li>
<li class="nav-item top-space nav-spacing"><a class="nav-link txt-color" href="/">Log Out</a></li>
</ul>
</div>
</div>
Expand Down
4 changes: 1 addition & 3 deletions templates/withdraw.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@
<li class="nav-item top-space nav-spacing"><a class="nav-link txt-color" href="/#contact">Contact</a></li>
<li class="nav-item top-space nav-spacing"><a class="nav-link txt-color" href="/faq">FAQ</a>
</li>
<li class="nav-item top-space nav-spacing"><a class="nav-link txt-color" href="/login">Login</a>
</li>
<li class="nav-item nav-spacing"><a class="nav-link txt-color" href="/register"><button type="button" class="btn btn-outline-primary btn-color">Register</button></a></li>
<li class="nav-item top-space nav-spacing"><a class="nav-link txt-color" href="/">Log Out</a></li>
</ul>
</div>
</div>
Expand Down

0 comments on commit 2f60c95

Please sign in to comment.