mirror of
https://github.com/sb745/NyaaV3.git
synced 2025-03-12 22:06:55 +02:00
Enforce password check on email change
Updated route handler to enforce current password check on all account details.
This commit is contained in:
parent
eedc6c170d
commit
1fb249be35
1 changed files with 6 additions and 1 deletions
|
@ -403,6 +403,11 @@ def profile():
|
|||
new_password = form.new_password.data
|
||||
|
||||
if new_email:
|
||||
# enforce password check on email change too
|
||||
if form.current_password.data != user.password_hash:
|
||||
flask.flash(flask.Markup(
|
||||
'<strong>Email change failed!</strong> Incorrect password.'), 'danger')
|
||||
return flask.redirect('/profile')
|
||||
user.email = form.email.data
|
||||
|
||||
if new_password:
|
||||
|
|
Loading…
Add table
Reference in a new issue