Fix mobile logout behavior

This commit is contained in:
Lance Edgar 2018-01-29 18:07:29 -06:00
parent 024f09dbd4
commit 9beb32cea2
2 changed files with 3 additions and 2 deletions

View file

@ -96,7 +96,7 @@
% elif request.is_admin: % elif request.is_admin:
<li class="root-user" data-icon="forbidden">${h.link_to("Become root", url('become_root'), **{'data-ajax': 'false'})}</li> <li class="root-user" data-icon="forbidden">${h.link_to("Become root", url('become_root'), **{'data-ajax': 'false'})}</li>
% endif % endif
<li data-icon="lock">${h.link_to("Logout", url('logout'), **{'data-ajax': 'false'})}</li> <li data-icon="lock">${h.link_to("Logout", url('mobile.logout'), **{'data-ajax': 'false'})}</li>
<li data-icon="info">${h.link_to("About {}".format(capture(self.app_title)), url('mobile.about'))}</li> <li data-icon="info">${h.link_to("About {}".format(capture(self.app_title)), url('mobile.about'))}</li>
</ul> </ul>
</div> </div>

View file

@ -143,7 +143,8 @@ class AuthenticationView(View):
""" """
headers = logout_user(self.request) headers = logout_user(self.request)
if self.rattail_config.getbool('tailbone', 'home_after_logout', default=False): if self.rattail_config.getbool('tailbone', 'home_after_logout', default=False):
return self.redirect(self.request.route_url('home'), headers=headers) home = 'mobile.home' if mobile else 'home'
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)