Add config for redirecting user to home page after logout

This commit is contained in:
Lance Edgar 2017-02-11 01:48:55 -06:00
parent 6121b16522
commit 61b3daa701

View file

@ -174,6 +174,8 @@ class AuthenticationView(View):
self.request.session.delete()
self.request.session.invalidate()
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'
referrer = self.request.get_referrer(default=self.request.route_url(login))
return self.redirect(referrer, headers=headers)