mirror of
https://github.com/JonathanHerrewijnen/calibre-web.git
synced 2024-11-14 07:03:50 +00:00
Moved password replace to prevent incomplete session
This commit is contained in:
parent
1bc7134ec2
commit
e8ac62cdd8
@ -450,11 +450,11 @@ def reset_password(user_id):
|
|||||||
existing_user = ub.session.query(ub.User).filter(ub.User.id == user_id).first()
|
existing_user = ub.session.query(ub.User).filter(ub.User.id == user_id).first()
|
||||||
if not existing_user:
|
if not existing_user:
|
||||||
return 0, None
|
return 0, None
|
||||||
password = generate_random_password()
|
|
||||||
existing_user.password = generate_password_hash(password)
|
|
||||||
if not config.get_mail_server_configured():
|
if not config.get_mail_server_configured():
|
||||||
return 2, None
|
return 2, None
|
||||||
try:
|
try:
|
||||||
|
password = generate_random_password()
|
||||||
|
existing_user.password = generate_password_hash(password)
|
||||||
ub.session.commit()
|
ub.session.commit()
|
||||||
send_registration_mail(existing_user.email, existing_user.nickname, password, True)
|
send_registration_mail(existing_user.email, existing_user.nickname, password, True)
|
||||||
return 1, existing_user.nickname
|
return 1, existing_user.nickname
|
||||||
|
Loading…
Reference in New Issue
Block a user