Merge branch 'bs4login'

This commit is contained in:
SecretlyTaco 2018-02-24 11:11:20 +00:00
commit eede104212
2 changed files with 5 additions and 1 deletions

View file

@ -22,7 +22,7 @@ def login():
login_attempt = accounts.login(username, password)
if login_attempt['status'] == 'success':
session['username'] = username.lower() if "@" not in username else accounts.username_for_email(username)
if request.form['remember']:
if 'remember' in request.form.keys():
session.permanent = True
return redirect(url_for('profile'))
else:

View file

@ -11,6 +11,10 @@
<form method="POST" action="/login" class="form-group">
<input name="username" type="text" class="form-control" style="margin-bottom: 12px; margin-top: 12px; height:45px;" tabindex="1" placeholder="Username or email address" />
<input name="password" type="password" class="form-control" style="margin-bottom: 12px; height:45px;" tabindex="2" placeholder="Password" />
<div class="custom-control custom-checkbox">
<input type="checkbox" name="remember" class="custom-control-input" id="customCheck1">
<label class="custom-control-label" for="customCheck1">Remember Me</label>
</div>
<input type="submit" class="form-control btn btn-primary" />
</form>
</div>