Hi,

in some projects I've had to interface with external authentication
sources that did expect the return-to URL in other formats than "%
(LOGIN_URL)s?%(redirect_field_name)s=%(url)s" (In one specific case it
was, e.g. required that the return URL had to be base64 encoded).

AFAIK there are currently two ways to accomplish that:

a) Set LOGIN_URL to a view that reformats the return URL and redirects
again (thereby having two redirects in a row)
b) Monkey patch user_passes_test (formerly _CheckLogin)

Neither of which I think are very good options.

So I would like to propose another option:
Allowing LOGIN_URL to be a callable which, in case of
user_passes_test, gets passed the redirect_field_name and return path
and returns the complete target URL.
Deciding whether the given string is a callable or an URL should be
simple; If the string contains at least one '/' it's an URL otherwise
it's a callable.

If it is felt this would be worthwhile to have in django (or if it is
even a good idea) I would be happy to provide a patch.

Thanks,
Ulrich

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

Reply via email to