Tuesday, September 1, 2015

Re: passwort reset next url

> 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?

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

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2Be%2BciW-NyXwbzTpCJKFvVRTrjJ7SCtEwsvWGBftsKOjdjRpsg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment