Updated account
This commit is contained in:
parent
0adabf3195
commit
1f389e1239
|
@ -161,12 +161,12 @@ def changepass():
|
|||
def register():
|
||||
# Get the form data
|
||||
username = request.form.get('username')
|
||||
passwordhash = request.form.get('passwordhash')
|
||||
verifyhash = request.form.get('passwordhash')
|
||||
password = request.form.get('password')
|
||||
|
||||
if passwordhash:
|
||||
is_password_valid = verify_bcrypt(password_to_check, passwordhash)
|
||||
if is_password_valid:
|
||||
passwordhash = fetch_hash_from_database(key_to_fetch)
|
||||
|
||||
if password == passwordhash:
|
||||
# Attempt to change the password
|
||||
if change_email_password(username, password):
|
||||
# Password changed
|
||||
|
@ -178,8 +178,6 @@ def register():
|
|||
return render_template('err.html'), 500
|
||||
else:
|
||||
return render_template('wrong.html'), 400
|
||||
else:
|
||||
return render_template('wrong.html'), 400
|
||||
|
||||
if __name__ == '__main__':
|
||||
serve(app, host='0.0.0.0', port=runport)
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
<div class="content">
|
||||
<h1>Change your password</h1>
|
||||
<br>
|
||||
<form method="POST" action="/account/changeapi">
|
||||
<input type="hidden" name="email" style="display: inline;" value="{{ user_email }}">
|
||||
<form method="POST" style="display: inline;" action="/account/changeapi">
|
||||
<input type="hidden" name="email" value="{{ user_email }}">
|
||||
<input type="hidden" name="passwordhash" value="{{ password_hash }}">
|
||||
<input name="password" required="">
|
||||
<input type="submit" value="Confirm">
|
||||
|
|
Loading…
Reference in New Issue