fix: redirection after password reset

This commit is contained in:
Éloi Rivard 2023-12-15 16:12:33 +01:00
parent 67733699aa
commit 7fed235437
No known key found for this signature in database
GPG key ID: 7EDA204EA57DD184
3 changed files with 7 additions and 3 deletions

View file

@ -8,6 +8,7 @@ Fixed
- Crash when no ACL were defined
- OIDC Userinfo endpoint is also available in POST
- Fix redirection after password reset :issue:`159`
[0.0.38] - 2023-12-15
=====================

View file

@ -214,9 +214,11 @@ def reset(user, hash):
login_user(user)
flash(_("Your password has been updated successfully"), "success")
return session.pop(
return redirect(
session.pop(
"redirect-after-login",
url_for("core.account.profile_edition", edited_user=user),
)
)
return render_template("reset-password.html", form=form, user=user, hash=hash)

View file

@ -11,6 +11,7 @@ def test_password_reset(testclient, user):
res.form["confirmation"] = "foobarbaz"
res = res.form.submit()
assert ("success", "Your password has been updated successfully") in res.flashes
assert res.location == "/profile/user"
user.reload()
assert user.check_password("foobarbaz")[0]