Merge pull request #1272 from BuhtigithuB/new-logout-bare
New logout_bare() for shell logout and refactor test using it
This commit is contained in:
@@ -250,7 +250,7 @@ class TestAuth(unittest.TestCase):
|
||||
self.assertTrue('name="_formkey"' in html_form)
|
||||
|
||||
# NOTE: Not sure it is the proper way to logout_bare() as there is not methods for that and auth.logout() failed
|
||||
self.auth.user = None
|
||||
self.auth.logout_bare()
|
||||
# self.assertTrue(self.auth.is_logged_in())
|
||||
|
||||
for f in ['logout', 'verify_email', 'reset_password',
|
||||
|
||||
@@ -3251,12 +3251,16 @@ class Auth(object):
|
||||
next = cas.logout_url(next)
|
||||
|
||||
current.session.auth = None
|
||||
self.user = None
|
||||
if self.settings.renew_session_onlogout:
|
||||
current.session.renew(clear_session=not self.settings.keep_session_onlogout)
|
||||
current.session.flash = self.messages.logged_out
|
||||
if next is not None:
|
||||
redirect(next)
|
||||
|
||||
def logout_bare(self):
|
||||
self.logout(next=None, onlogout=None, log=None)
|
||||
|
||||
def register(self,
|
||||
next=DEFAULT,
|
||||
onvalidation=DEFAULT,
|
||||
|
||||
Reference in New Issue
Block a user