* To django-users@googlegroups.com [2011-06-17 19:34]:
> ... but the auth app doesn't like "next" pointing to a differt domain and
> ignores it. I got it to work with the following patch to Django:

Ok, I solved the problem without a patch by checking in my view if a
redirect exception is required...

netloc = urlparse.urlparse(next)[1]
if (netloc and netloc != request.get_host() and
    netloc in settings.LOGIN_REDIRECT_WHITELIST):
        redirect_exception = next

... and if so, modifying the login() response:

response = login(...)
if redirect_exception and isinstance(response, HttpResponseRedirect):
       return HttpResponseRedirect(redirect_exception)
return response

Should have thought a bit more before posting, I guess.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to