Simplify the code
This commit is contained in:
parent
f8ebff12f3
commit
27c7a47c46
1 changed files with 1 additions and 11 deletions
|
@ -66,23 +66,13 @@ class GenericLoginView(View):
|
||||||
# Issue token.
|
# Issue token.
|
||||||
token = GenericTeamToken.objects.create_token()
|
token = GenericTeamToken.objects.create_token()
|
||||||
|
|
||||||
# Prepare callback of logout.
|
|
||||||
here_url = reverse(login_generic)
|
|
||||||
if "next" in self.request.GET:
|
|
||||||
# Keep given next page.
|
|
||||||
here_qd = QueryDict(mutable=True)
|
|
||||||
here_qd["next"] = self.request.GET["next"]
|
|
||||||
here_url += "?{}".format(here_qd.urlencode())
|
|
||||||
|
|
||||||
# When CAS logs the user out, the generic login has to be called back.
|
# When CAS logs the user out, the generic login has to be called back.
|
||||||
# The corresponding callback URL is provided as a GET parameter.
|
# The corresponding callback URL is provided as a GET parameter.
|
||||||
# The renaming of the CAS logout "url" parameter to "service" is being forced,
|
# The renaming of the CAS logout "url" parameter to "service" is being forced,
|
||||||
# which is why the CAS logout URL with callback is constructed ad hoc,
|
# which is why the CAS logout URL with callback is constructed ad hoc,
|
||||||
# without relying on Django redirection to Django CAS.
|
# without relying on Django redirection to Django CAS.
|
||||||
|
|
||||||
# An HTTP absolute URL as callback seems to be required for the K-Psul link
|
generic_login_url = request.build_absolute_uri() # preserves next parameter
|
||||||
# to work.
|
|
||||||
generic_login_url = "http://" + request.get_host() + here_url
|
|
||||||
generic_login_qd = QueryDict(mutable=True)
|
generic_login_qd = QueryDict(mutable=True)
|
||||||
generic_login_qd["service"] = generic_login_url
|
generic_login_qd["service"] = generic_login_url
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue