user authentication
This commit is contained in:
21
templates/admin.html
Normal file
21
templates/admin.html
Normal file
@@ -0,0 +1,21 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h2>Logged in User details</h2>
|
||||
|
||||
<ul>
|
||||
<li>Username: {{ current_user.username }}</li>
|
||||
<li>Email: {{ current_user.email }}</li>
|
||||
<li>Created on: {{ current_user.created_on }}</li>
|
||||
<li>Updated on: {{ current_user.updated_on }}</li>
|
||||
</ul>
|
||||
|
||||
<p><a href="{{ url_for('logout') }}">Logout</a></p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -6,21 +6,36 @@
|
||||
</head>
|
||||
<body>
|
||||
|
||||
{% if message %}
|
||||
<p>{{ message }}</p>
|
||||
{% endif %}
|
||||
{% for category, message in get_flashed_messages(with_categories=true) %}
|
||||
<spam class="{{ category }}">{{ message }}</spam>
|
||||
{% endfor %}
|
||||
|
||||
<form action="" method="post">
|
||||
<p>
|
||||
<label for="username">Username</label>
|
||||
<input type="text" name="username">
|
||||
{{ form.csrf_token }}
|
||||
<p>
|
||||
{{ form.username.label() }}
|
||||
{{ form.username() }}
|
||||
{% if form.username.errors %}
|
||||
{% for error in form.username.errors %}
|
||||
{{ error }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</p>
|
||||
<p>
|
||||
<label for="password">Password</label>
|
||||
<input type="password" name="password">
|
||||
{{ form.password.label() }}
|
||||
{{ form.password() }}
|
||||
{% if form.password.errors %}
|
||||
{% for error in form.password.errors %}
|
||||
{{ error }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</p>
|
||||
<p>
|
||||
<input type="submit">
|
||||
{{ form.remember.label() }}
|
||||
{{ form.remember() }}
|
||||
</p>
|
||||
<p>
|
||||
{{ form.submit() }}
|
||||
</p>
|
||||
</form>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user