Merge branch 'bs4login'
This commit is contained in:
commit
eede104212
2 changed files with 5 additions and 1 deletions
|
@ -22,7 +22,7 @@ def login():
|
||||||
login_attempt = accounts.login(username, password)
|
login_attempt = accounts.login(username, password)
|
||||||
if login_attempt['status'] == 'success':
|
if login_attempt['status'] == 'success':
|
||||||
session['username'] = username.lower() if "@" not in username else accounts.username_for_email(username)
|
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
|
session.permanent = True
|
||||||
return redirect(url_for('profile'))
|
return redirect(url_for('profile'))
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -11,6 +11,10 @@
|
||||||
<form method="POST" action="/login" class="form-group">
|
<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="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" />
|
<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" />
|
<input type="submit" class="form-control btn btn-primary" />
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue