Add config for redirecting user to home page after logout
This commit is contained in:
parent
6121b16522
commit
61b3daa701
|
@ -174,6 +174,8 @@ class AuthenticationView(View):
|
||||||
self.request.session.delete()
|
self.request.session.delete()
|
||||||
self.request.session.invalidate()
|
self.request.session.invalidate()
|
||||||
headers = forget(self.request)
|
headers = forget(self.request)
|
||||||
|
if self.rattail_config.getbool('tailbone', 'home_after_logout', default=False):
|
||||||
|
return self.redirect(self.request.route_url('home'), headers=headers)
|
||||||
login = 'mobile.login' if mobile else 'login'
|
login = 'mobile.login' if mobile else 'login'
|
||||||
referrer = self.request.get_referrer(default=self.request.route_url(login))
|
referrer = self.request.get_referrer(default=self.request.route_url(login))
|
||||||
return self.redirect(referrer, headers=headers)
|
return self.redirect(referrer, headers=headers)
|
||||||
|
|
Loading…
Reference in a new issue