From: Michael Tremer Date: Fri, 15 Dec 2023 13:50:03 +0000 (+0000) Subject: auth: Implement /.well-known/change-password X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=69a212f30011b7bb8b49739ce850a334ba69a1d9;p=ipfire.org.git auth: Implement /.well-known/change-password Signed-off-by: Michael Tremer --- diff --git a/src/web/__init__.py b/src/web/__init__.py index b7cafbba..1b7dbfb9 100644 --- a/src/web/__init__.py +++ b/src/web/__init__.py @@ -169,6 +169,7 @@ class Application(tornado.web.Application): # Password Reset (r"/password\-reset", auth.PasswordResetInitiationHandler), (r"/password\-reset/([a-z_][a-z0-9_-]{0,31})/(\w+)", auth.PasswordResetHandler), + (r"/.well-known/change-password", auth.WellKnownChangePasswordHandler), # Projects (r"/projects/location", location.IndexHandler), diff --git a/src/web/auth.py b/src/web/auth.py index 352a9f47..f14a184c 100644 --- a/src/web/auth.py +++ b/src/web/auth.py @@ -178,6 +178,15 @@ class PasswordResetHandler(AuthenticationMixin, base.BaseHandler): self.redirect("/") +class WellKnownChangePasswordHandler(base.BaseHandler): + @tornado.web.authenticated + def get(self): + """ + Implements https://web.dev/articles/change-password-url + """ + self.redirect("/users/%s/passwd" % self.current_user.uid) + + class SSODiscourse(base.BaseHandler): @base.ratelimit(minutes=24*60, requests=100) @tornado.web.authenticated