File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
src/genweb6/core/portlets/login Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,14 @@ class gwLogin(LoginRenderer, LoginUtils):
1414
1515 def cas_login_URL (self ):
1616 login_url = login_URL (self .context , self .request )
17+
18+ # Si tiene el ticket en la url, quiere decir que es un usuario válido pero no tiene permisos.
19+ # Por tanto, redirigimos a la página de error para evitar el bucle infinito del SSO
20+ # En el log vemos Unauthorized(m) - zExceptions.unauthorized.Unauthorized: You are not authorized to access this resource.
21+ if 'ticket' in getattr (self .request , 'came_from' , '' ):
22+ return self .request .response .redirect (
23+ self .context .absolute_url () + '/insufficient-privileges' )
24+
1725 url = self .context .absolute_url ()
1826 if any (x in url for x in ['localhost' , 'fepre.upc.edu' , '.pre.upc.edu' ]):
1927 return False
You can’t perform that action at this time.
0 commit comments