passwort reset next url

25 views
Skip to first unread message

hinnack

unread,
Aug 31, 2015, 1:56:28 PM8/31/15
to Django users
Hi,

I have implemented my own password reset by overwriting the templates of django.contrib.auth
If I go to the login page e.g. /login I usually have a GET parameter "next" where I want to be redirected after successful login.
If I have forgotten my password, I would like to jump into the password reset process, but be able to use the next parameter after successful password reset and provide a link to /login?next=… to guide the user back to the login page in the sam manner, as before.

How can I do this?

kind regards

Hinnack

James Schneider

unread,
Sep 1, 2015, 2:30:11 PM9/1/15
to django...@googlegroups.com
Are you using sessions? You could track the next parameter within the
session and after the password reset either add it as a hidden element
in the login form, or redirect the user back to the login page using a
URL that includes the ?next= value.

https://docs.djangoproject.com/en/1.8/topics/http/sessions/

Another option would be to keep the next parameter as part of the URL
all the way through the password reset process if you don't want to
store it in the session, but that would require that you grab it every
time the user loads a new page, which is probably more cumbersome than
sessions to generate the URL's and to capture/store the parameter upon
ever request.

-James
Reply all
Reply to author
Forward
0 new messages