Skip to content

Commit 591ea25

Browse files
onovyredimp
authored andcommitted
feat(auth): add /.well-known/change-password redirect to settings
Implements the W3C well-known change password URL spec (https://w3c.github.io/webappsec-change-password-url/) so that browsers and password managers can direct users directly to the password change page.
1 parent e8dbab9 commit 591ea25

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

otterwiki/views.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ def favicon():
9191
)
9292

9393

94+
@app.route("/.well-known/change-password")
95+
def well_known_change_password():
96+
return redirect(url_for("settings"))
97+
98+
9499
@app.route("/-/healthz")
95100
def healthz():
96101
healthy, msgs = health_check()

tests/test_essentials.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,9 @@ def test_fatal_error():
2828
fatal_error("test_fatal_error")
2929
assert pytest_wrapped_e.type == SystemExit
3030
assert pytest_wrapped_e.value.code == 1
31+
32+
33+
def test_well_known_change_password(test_client):
34+
response = test_client.get("/.well-known/change-password")
35+
assert response.status_code == 302
36+
assert "/-/settings" in response.headers["Location"]

0 commit comments

Comments
 (0)