Add some code comments
This commit is contained in:
parent
ea0dc1ea19
commit
acaa83c31a
|
@ -141,10 +141,15 @@ class AuthenticationView(View):
|
||||||
This deletes/invalidates the current session and then redirects to the
|
This deletes/invalidates the current session and then redirects to the
|
||||||
login page.
|
login page.
|
||||||
"""
|
"""
|
||||||
|
# truly logout the user
|
||||||
headers = logout_user(self.request)
|
headers = logout_user(self.request)
|
||||||
|
|
||||||
|
# redirect to home page after login, if so configured
|
||||||
if self.rattail_config.getbool('tailbone', 'home_after_logout', default=False):
|
if self.rattail_config.getbool('tailbone', 'home_after_logout', default=False):
|
||||||
home = 'mobile.home' if mobile else 'home'
|
home = 'mobile.home' if mobile else 'home'
|
||||||
return self.redirect(self.request.route_url(home), headers=headers)
|
return self.redirect(self.request.route_url(home), headers=headers)
|
||||||
|
|
||||||
|
# otherwise redirect to referrer, with 'login' page as fallback
|
||||||
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