From 8c4ed443f93fc37fa9d96f77edf9d396fb8cfdee Mon Sep 17 00:00:00 2001 From: Christian Dresen <c.dresen@fh-muenster.de> Date: Mon, 19 Sep 2016 22:46:29 +0200 Subject: [PATCH] [Warpauth] Changed password reset url in /account/ --- www/web/templates/two_factor/core/login.html | 2 +- www/web/warpauth/urls.py | 4 ++-- www/web/warpauth/views/reset_password.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/www/web/templates/two_factor/core/login.html b/www/web/templates/two_factor/core/login.html index 0d36ba5..63012d4 100644 --- a/www/web/templates/two_factor/core/login.html +++ b/www/web/templates/two_factor/core/login.html @@ -51,7 +51,7 @@ {% include "two_factor/_wizard_actions.html" %} </form> </div> -<a class="btn" href="/reset_password">{% trans "Forgot Password?" %}</a><br> +<a class="btn" href="/account/reset_password">{% trans "Forgot Password?" %}</a><br> <a class="btn" href="/account/registration/">{% trans "Register" %}</a><br> <a class="btn" href="/account/registration/resend">{% trans "Resend Activation Link" %}</a> {% endblock %} \ No newline at end of file diff --git a/www/web/warpauth/urls.py b/www/web/warpauth/urls.py index 4c294b4..d3fa672 100644 --- a/www/web/warpauth/urls.py +++ b/www/web/warpauth/urls.py @@ -14,8 +14,8 @@ urlpatterns = [ url(r'^account/registration/activate/(?P<token>\w+)/$', register.activate, name='activate'), url(r'^account/registration/resend/$', register.resend_token, name='resend_token'), - url(r'^reset_password/$', reset_password.gen_token, name='reset_password'), - url(r'^reset_password/(?P<reset_hash>\w+)/$', reset_password.change_password, name='index'), + url(r'^/account/reset_password/$', reset_password.gen_token, name='reset_password'), + url(r'^/account/reset_password/(?P<reset_hash>\w+)/$', reset_password.change_password, name='index'), url(r'^profile/$', profile.index, name='index'), url(r'^profile/change_password/$', profile.change_password, name='change_password'), diff --git a/www/web/warpauth/views/reset_password.py b/www/web/warpauth/views/reset_password.py index fb6f806..4be1cbb 100644 --- a/www/web/warpauth/views/reset_password.py +++ b/www/web/warpauth/views/reset_password.py @@ -32,7 +32,7 @@ def gen_token(request): p.email = usr.email p.hash = hashlib.sha1(os.urandom(128)).hexdigest() p.save() - email_content = _("https://infra.warpzone.ms/reset_password/%(hash)s") % {'hash': p.hash} + email_content = _("https://infra.warpzone.ms/account/reset_password/%(hash)s") % {'hash': p.hash} ret = send_email(p.email, "Requested Password Reset", email_content ) if not ret: pages["error"] = "Error while sending the email. Please contact the administrator." -- GitLab