Redirect link included in links for password reset

on sign-in page.
This commit is contained in:
Pea Tyczynska
2020-10-05 15:38:34 +01:00
parent 1b310a0f8a
commit ab10009e4d
3 changed files with 17 additions and 5 deletions

View File

@@ -24,6 +24,7 @@ def sign_in():
return redirect(url_for('main.show_accounts_or_dashboard'))
form = LoginForm()
password_reset_url = url_for('.forgot_password', next=request.args.get('next'))
if form.validate_on_submit():
@@ -51,9 +52,9 @@ def sign_in():
# Vague error message for login in case of user not known, locked, inactive or password not verified
flash(Markup(
(
"The email address or password you entered is incorrect."
" <a href={password_reset}>Forgotten your password?</a>"
).format(password_reset=url_for('.forgot_password'))
f"The email address or password you entered is incorrect."
f" <a href={password_reset_url}>Forgotten your password?</a>"
)
))
other_device = current_user.logged_in_elsewhere()
@@ -61,7 +62,8 @@ def sign_in():
'views/signin.html',
form=form,
again=bool(request.args.get('next')),
other_device=other_device
other_device=other_device,
password_reset_url=password_reset_url
)