Commit 5b839ef5 authored by Daniel STAN's avatar Daniel STAN

wiki/cas: redirect only if action=login_cas

Du coup, ça faisait encore merder la suppression de PJ.
parent 9e62ca40
......@@ -138,10 +138,6 @@ class CASAuth(BaseAuth):
sys.stderr.write("Tentative de deconnexion du CAS : %s\n" % logoutRequest)
self.cas.singlesignout(logout_user, logoutRequest)
# anonymous
if not ticket and not self.action == action:
return user_obj, True
# valid ticket on CAS
if ticket and ticket.startswith('ST-'):
valid, username = self.cas.validate_ticket(url, ticket)
......@@ -160,9 +156,10 @@ class CASAuth(BaseAuth):
store_ticket(ticket, username)
load_theme_fallback(request, u.theme_name)
return u, True
# login
request.http_redirect(self.cas.login_url(url))
else:
request.http_redirect(self.cas.login_url(url))
elif self.action == action: # Redirect login
request.http_redirect(self.cas.login_url(url))
return user_obj, True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment