Some login/logout fixes

This commit is contained in:
Sage Vaillancourt 2022-09-23 19:12:07 +00:00
parent 396376669c
commit 6f456fc5ce
2 changed files with 4 additions and 4 deletions

View File

@ -80,7 +80,7 @@ def login():
'''
@writing_blueprint.route('/logout', methods=['POST'])
@writing_blueprint.route('/logout', methods=['POST', 'GET'])
def logout():
session.pop('username', None)
return redirect('/')
@ -91,7 +91,7 @@ def index_get():
return render_template(
'writing.jinja2',
form=CLForm(),
username=session['username']
username=session.get('username')
)

View File

@ -51,14 +51,14 @@
{% else %}
<div class="user logged-out">
<p>You are here as a guest.</p>
<form action="/login">
<form action="/login" method=post>
<label for="username">Username: </label>
<input id="username" maxlength="32" minlength="4" name="username" type="text" placeholder="sagev9000">
<label for="password">Password: </label>
<input id="password" maxlength="32" minlength="4" name="password" type="password">
<input type="submit" value="Logout">
<input type="submit" value="Login">
</form>
</div>
{% endif %}