From 9beb32cea235100a19bc2c5e824039430977e5cc Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 29 Jan 2018 18:07:29 -0600 Subject: [PATCH] Fix mobile logout behavior --- tailbone/templates/mobile/base.mako | 2 +- tailbone/views/auth.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tailbone/templates/mobile/base.mako b/tailbone/templates/mobile/base.mako index 28d5ffe1..29a217bb 100644 --- a/tailbone/templates/mobile/base.mako +++ b/tailbone/templates/mobile/base.mako @@ -96,7 +96,7 @@ % elif request.is_admin:
  • ${h.link_to("Become root", url('become_root'), **{'data-ajax': 'false'})}
  • % endif -
  • ${h.link_to("Logout", url('logout'), **{'data-ajax': 'false'})}
  • +
  • ${h.link_to("Logout", url('mobile.logout'), **{'data-ajax': 'false'})}
  • ${h.link_to("About {}".format(capture(self.app_title)), url('mobile.about'))}
  • diff --git a/tailbone/views/auth.py b/tailbone/views/auth.py index de6e33ee..44a6ac0d 100644 --- a/tailbone/views/auth.py +++ b/tailbone/views/auth.py @@ -143,7 +143,8 @@ class AuthenticationView(View): """ headers = logout_user(self.request) 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' referrer = self.request.get_referrer(default=self.request.route_url(login)) return self.redirect(referrer, headers=headers)