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():
|
def logout():
|
||||||
session.pop('username', None)
|
session.pop('username', None)
|
||||||
return redirect('/')
|
return redirect('/')
|
||||||
|
@ -91,7 +91,7 @@ def index_get():
|
||||||
return render_template(
|
return render_template(
|
||||||
'writing.jinja2',
|
'writing.jinja2',
|
||||||
form=CLForm(),
|
form=CLForm(),
|
||||||
username=session['username']
|
username=session.get('username')
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -51,14 +51,14 @@
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="user logged-out">
|
<div class="user logged-out">
|
||||||
<p>You are here as a guest.</p>
|
<p>You are here as a guest.</p>
|
||||||
<form action="/login">
|
<form action="/login" method=post>
|
||||||
<label for="username">Username: </label>
|
<label for="username">Username: </label>
|
||||||
<input id="username" maxlength="32" minlength="4" name="username" type="text" placeholder="sagev9000">
|
<input id="username" maxlength="32" minlength="4" name="username" type="text" placeholder="sagev9000">
|
||||||
|
|
||||||
<label for="password">Password: </label>
|
<label for="password">Password: </label>
|
||||||
<input id="password" maxlength="32" minlength="4" name="password" type="password">
|
<input id="password" maxlength="32" minlength="4" name="password" type="password">
|
||||||
|
|
||||||
<input type="submit" value="Logout">
|
<input type="submit" value="Login">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in New Issue