marazmiki / django-ulogin

Plug a social authentication feature to your Django application easy!
https://django-ulogin.readthedocs.io/ru/latest/
MIT License
26 stars 19 forks source link

Login "next" url is ignored on login pages #2

Closed ZlobnyiSerg closed 13 years ago

ZlobnyiSerg commented 13 years ago

When using standard "requires_login" wrapper on views, it redirects unauthenticated users to urls like '/login/?next=private', it would be wonderful if 'next' query parameter will not be ignored on login process via uLogin. This parameter should be passed to uLogin script and used as redirect url after logging in.

marazmiki commented 13 years ago

Unfortunately, ulogin only returns the authentication information and therefore we can't obtain the 'next' parameter.

ZlobnyiSerg commented 13 years ago

But you can put 'next' query parameter into uLogin's redirect_uri=..., when templatetag forms ulogin script url, and after get this url from request in your postback view, i.e. do not redirect to the site url like so:

return redirect('/')

this is completely incorrect, rather than do something like

return redirect(request.GET.get('next', '/'))
marazmiki commented 13 years ago

I'm understand. Ok, I'll add this feature, thanks