Add option to logout
This commit is contained in:
parent
49b228c1a5
commit
32e06e9d98
5 changed files with 25 additions and 1 deletions
|
|
@ -16,7 +16,10 @@
|
|||
|
||||
<body>
|
||||
{% block nav %}{{ navbar() }}{% endblock %}
|
||||
<div class="container mt-3">
|
||||
{% include "flash_msg.html" %}
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
{% block scripts %}{% endblock %}
|
||||
<script src="https://unpkg.com/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
|
||||
</body>
|
||||
|
|
|
|||
10
templates/flash_msg.html
Normal file
10
templates/flash_msg.html
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{% with messages = get_flashed_messages() %}
|
||||
{% if messages %}
|
||||
{% for message in messages %}
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
{{ message }}
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
<form method="POST">
|
||||
<div class="mb-3">
|
||||
<label for="username" class="form-label">username</label>
|
||||
<input class="form-control" id="username" name="username">
|
||||
<input class="form-control" id="username" name="username" value="{{ request.form.username }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="password" class="form-label">Password</label>
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
{% set pages = [
|
||||
{"endpoint": "root_page", "label": "Home" },
|
||||
{"endpoint": "login_page", "label": "Login" },
|
||||
{"endpoint": "logout", "label": "Logout" },
|
||||
] %}
|
||||
{% set project = "Auth" %}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue