completed authentication system
This commit is contained in:
@@ -29,6 +29,14 @@
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="float-right">
|
||||
{% if current_user.is_authenticated %}
|
||||
<a href="{{ url_for('logout') }}" class="nav-link"> Logout {{current_user.userName}} </a>
|
||||
{% endif %}
|
||||
{% if not current_user.is_authenticated %}
|
||||
<a href="{{ url_for('login') }}" class="nav-link"> Login </a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</nav>
|
||||
<hr>
|
||||
<div class="container">
|
||||
|
34
templates/createAccount.html
Normal file
34
templates/createAccount.html
Normal file
@@ -0,0 +1,34 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<span><h1>{% block title %} Create Account {% endblock %}</h1></span>
|
||||
{% with messages = get_flashed_messages() %}
|
||||
{% if messages %}
|
||||
<div class="notification is-danger">
|
||||
{{ messages[0] }}. Go to <a href="{{ url_for('login') }}">login page</a>.
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
<form method="post">
|
||||
{{ form.csrf_token }}
|
||||
<p>
|
||||
{{ form.userName.label }}
|
||||
{{ form.userName }}
|
||||
</p>
|
||||
<p>
|
||||
{{ form.password.label }}
|
||||
{{ form.password }}
|
||||
</p>
|
||||
<p>
|
||||
{{ form.realName.label }}
|
||||
{{ form.realName }}
|
||||
</p>
|
||||
<p>
|
||||
{{ form.email.label }}
|
||||
{{ form.email }}
|
||||
</p>
|
||||
<p>
|
||||
<button class="btn btn-primary" type="submit">Submit</button>
|
||||
</p>
|
||||
</form>
|
||||
{% endblock %}
|
@@ -1,29 +1,26 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div>
|
||||
<h3>Login</h3>
|
||||
<div>
|
||||
<form method="POST" action="/login">
|
||||
<div>
|
||||
<div>
|
||||
<input type="email" name="email" placeholder="Your Email" autofocus="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div>
|
||||
<input type="password" name="password" placeholder="Your Password">
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<input type="checkbox" name="remember">
|
||||
Remember me
|
||||
</label>
|
||||
</div>
|
||||
<button>Login</button>
|
||||
</form>
|
||||
<span><h1>{% block title %} Login {% endblock %}</h1></span>
|
||||
{% with messages = get_flashed_messages() %}
|
||||
{% if messages %}
|
||||
<div class="notification is-danger">
|
||||
{{ messages[0] }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
<form method="post">
|
||||
{{ form.csrf_token }}
|
||||
<p>
|
||||
{{ form.userName.label }}
|
||||
{{ form.userName }}
|
||||
</p>
|
||||
<p>
|
||||
{{ form.password.label }}
|
||||
{{ form.password }}
|
||||
</p>
|
||||
<p>
|
||||
<button class="btn btn-primary" type="submit">Submit</button>
|
||||
</p>
|
||||
</form>
|
||||
{% endblock %}
|
Reference in New Issue
Block a user