authorization routes and logic

This commit is contained in:
Bryan Bailey
2022-04-06 01:24:06 -04:00
parent 5ca91452ca
commit be4eda6686
13 changed files with 205 additions and 6 deletions

View File

@@ -0,0 +1,19 @@
{% extends "base.html" %}
{% block title %}Yo!nk - Login{% endblock %}
{% block page_content %}
<div class="page-header">
<h1>Login</h1>
</div>
<div class="col-md-4">
<form method="post">
{{ form.hidden_tag() }}
{{ form.email.label }} {{ form.email() }}
{{ form.password.label }} {{ form.password() }}
{{ form.remember_me.label }} {{ form.remember_me() }}
{{ form.submit() }}
</form>
<p>New User? Click <a href="{{ url_for('auth.register') }}">here</a> to register a free account.</p>
</div>
{% endblock %}

View File

@@ -30,6 +30,18 @@
</button>
<a href="/" class="navbar-brand">Y!oink</a>
<ul class="nav navbar-nav navbar-right">
{% if current_user.is_authenticated %}
<li>
<a href="{{ url_for('auth.logout') }}">Log Out</a>
</li>
{% else %}
<li>
<a href="{{ url_for('auth.login') }}">Log In</a>
</li>
{% endif %}
</ul>
</div>
<div class="navbar-collapse collapse">

View File

@@ -25,7 +25,11 @@
{{ form.download(class_='btn btn-outline-primary') }}
</div>
</form>
{% if current_user.is_authenticated %}
<h2>{{ current_user.username }}'s Library</h2>
{% else %}
<h2>Comic Library</h2>
{% endif %}
{{ library.latest_downloads(latest) }}
{% endblock %}