Some login/logout fixes
This commit is contained in:
parent
396376669c
commit
6f456fc5ce
|
@ -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')
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -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 %}
|
||||
|
|
Loading…
Reference in New Issue