From: Michael Tremer Date: Wed, 28 Jun 2023 16:47:48 +0000 (+0000) Subject: auth: Move Password module X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5806d6fca17e77374ba326eb8ff4c30c2c742bc2;p=ipfire.org.git auth: Move Password module Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index 60546077..5144f2bb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -139,6 +139,12 @@ templates_auth_messages_DATA = \ templates_auth_messagesdir = $(templates_authdir)/messages +templates_auth_modules_DATA = \ + src/templates/auth/modules/password.html \ + src/templates/auth/modules/password.js + +templates_auth_modulesdir = $(templates_authdir)/modules + templates_blog_DATA = \ src/templates/blog/author.html \ src/templates/blog/base.html \ @@ -285,12 +291,6 @@ templates_people_messages_DATA = \ templates_people_messagesdir = $(templates_peopledir)/messages -templates_people_modules_DATA = \ - src/templates/people/modules/password.html \ - src/templates/people/modules/password.js - -templates_people_modulesdir = $(templates_peopledir)/modules - templates_static_DATA = \ src/templates/static/about.html \ src/templates/static/legal.html \ diff --git a/src/templates/people/modules/password.html b/src/templates/auth/modules/password.html similarity index 100% rename from src/templates/people/modules/password.html rename to src/templates/auth/modules/password.html diff --git a/src/templates/people/modules/password.js b/src/templates/auth/modules/password.js similarity index 100% rename from src/templates/people/modules/password.js rename to src/templates/auth/modules/password.js diff --git a/src/web/__init__.py b/src/web/__init__.py index dbf510c2..78659644 100644 --- a/src/web/__init__.py +++ b/src/web/__init__.py @@ -61,6 +61,9 @@ class Application(tornado.web.Application): # UI Modules "ui_modules" : { + # Auth + "Password" : auth.PasswordModule, + # Blog "BlogHistoryNavigation": blog.HistoryNavigationModule, "BlogList" : blog.ListModule, @@ -74,9 +77,6 @@ class Application(tornado.web.Application): # Docs "DocsHeader" : docs.HeaderModule, - # People - "Password" : people.PasswordModule, - # Nopaste "Code" : nopaste.CodeModule, diff --git a/src/web/auth.py b/src/web/auth.py index 9e3bf712..352a9f47 100644 --- a/src/web/auth.py +++ b/src/web/auth.py @@ -5,6 +5,7 @@ import tornado.web import urllib.parse from . import base +from . import ui_modules class AuthenticationMixin(object): def login(self, account): @@ -232,6 +233,17 @@ class SSODiscourse(base.BaseHandler): self.redirect("%s?%s" % (params.get("return_sso_url"), qs)) +class PasswordModule(ui_modules.UIModule): + def render(self, account=None): + return self.render_string("auth/modules/password.html", account=account) + + def javascript_files(self): + return "js/zxcvbn.js" + + def embedded_javascript(self): + return self.render_string("auth/modules/password.js") + + class APICheckUID(base.APIHandler): @base.ratelimit(minutes=1, requests=100) def get(self): diff --git a/src/web/people.py b/src/web/people.py index 3700d958..83ab51a7 100644 --- a/src/web/people.py +++ b/src/web/people.py @@ -34,14 +34,3 @@ class UnsubscribeHandler(base.BaseHandler): self.current_user.consents_to_promotional_emails = False self.render("people/unsubscribed.html") - - -class PasswordModule(ui_modules.UIModule): - def render(self, account=None): - return self.render_string("people/modules/password.html", account=account) - - def javascript_files(self): - return "js/zxcvbn.js" - - def embedded_javascript(self): - return self.render_string("people/modules/password.js")