logout: allow overriding of redirect by ILogout adapter
This commit is contained in:
parent
36b864098a
commit
7615bdd746
1 changed files with 2 additions and 1 deletions
|
@ -50,10 +50,11 @@ class Logout(object):
|
||||||
|
|
||||||
def __call__(self):
|
def __call__(self):
|
||||||
nextUrl = self.request.get('nextURL') or self.request.URL[-1]
|
nextUrl = self.request.get('nextURL') or self.request.URL[-1]
|
||||||
|
nx = self.request.response.redirect(nextUrl)
|
||||||
if not IUnauthenticatedPrincipal.providedBy(self.request.principal):
|
if not IUnauthenticatedPrincipal.providedBy(self.request.principal):
|
||||||
auth = component.getUtility(IAuthentication)
|
auth = component.getUtility(IAuthentication)
|
||||||
ILogout(auth).logout(self.request)
|
ILogout(auth).logout(self.request)
|
||||||
return self.request.response.redirect(nextUrl)
|
return nx
|
||||||
|
|
||||||
|
|
||||||
class Unauthorized(ConceptView):
|
class Unauthorized(ConceptView):
|
||||||
|
|
Loading…
Add table
Reference in a new issue