Add simple user login via flask_login
This doesn't do much - it'll authenticate any username and password. But at least it will show me when a user is logged in and when they aren't, which is useful to start figuring out the workflow for sessions
This commit is contained in:
parent
ccde1908ba
commit
94b78dacca
3 changed files with 70 additions and 6 deletions
14
templates/index.html
Normal file
14
templates/index.html
Normal file
|
@ -0,0 +1,14 @@
|
|||
<html>
|
||||
<body>
|
||||
{% if current_user and current_user.is_authenticated %}
|
||||
<h1>Hello {{ current_user.name }} from Vanth</h1>
|
||||
{% else %}
|
||||
<h1>Please log in</h1>
|
||||
<form action="/login/" method="POST">
|
||||
<label>username</label><input type="text" name="username"></input>
|
||||
<label>password</label><input type="password" name="password"></input>
|
||||
<input type="submit">Log in</input>
|
||||
</form>
|
||||
{% endif %}
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue