mirror of
https://github.com/Xevion/runnerspace.git
synced 2025-12-17 20:13:09 -06:00
Migrate app to use WTForms for auth form validation
- Not finished yet, major styling breakage in this commit - Also encapsulated GET & POST requests of /login and /signup routes into one route.
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
{% extends 'layouts/index.html' %}
|
||||
{% from 'macros.html' import render_field %}
|
||||
|
||||
{% block content %}
|
||||
{% with messages = get_flashed_messages() %}
|
||||
{% if messages %}
|
||||
@@ -7,29 +9,14 @@
|
||||
</span>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
<form method="POST" action="{{ url_for('auth.login_post') }}" class="login-form">
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
Username
|
||||
<input class="input is-large" type="text" name="username" placeholder="Username" autofocus="true">
|
||||
</div>
|
||||
</div>
|
||||
<form method="POST" action="{{ url_for('auth.login') }}" class="login-form">
|
||||
{{ render_field(form.username) }}
|
||||
{{ render_field(form.password) }}
|
||||
{{ render_field(form.remember_me) }}
|
||||
<p><input type=submit value=Login>
|
||||
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
Password
|
||||
<input class="input is-large" type="password" name="password" placeholder="Password">
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox">
|
||||
Remember me
|
||||
</label>
|
||||
</div>
|
||||
<button class="button">Login</button>
|
||||
</form>
|
||||
<p class="form-subtext">
|
||||
Don't have a login? <a href="{{ url_for('main.signup') }}">Sign-up</a> instead!
|
||||
Don't have a login? <a href="{{ url_for('auth.signup') }}">Sign-up</a> instead!
|
||||
</p>
|
||||
{% endblock content %}
|
||||
|
||||
Reference in New Issue
Block a user