mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-09 01:58:11 +08:00
auth: logging out should keep the user on the same page (#1877)
previous behavior is that logout would redirect to the index page.
This commit is contained in:
@@ -112,7 +112,7 @@ class AuthTest(unittest.TestCase):
|
||||
logout_uri = config["config"]["authentication"]["logout"]
|
||||
|
||||
self.assertEqual(login_uri, f"{server}/login?dataset=d/pbmc3k.cxg/")
|
||||
self.assertEqual(logout_uri, f"{server}/logout")
|
||||
self.assertEqual(logout_uri, f"{server}/logout?dataset=d/pbmc3k.cxg/")
|
||||
|
||||
r = session.get(login_uri)
|
||||
# check that the login redirect worked
|
||||
@@ -151,7 +151,7 @@ class AuthTest(unittest.TestCase):
|
||||
r = session.get(logout_uri)
|
||||
# check that the logout redirect worked
|
||||
self.assertEqual(r.history[0].status_code, 302)
|
||||
self.assertEqual(r.url, f"{server}")
|
||||
self.assertEqual(r.url, f"{server}/d/pbmc3k.cxg/")
|
||||
config = session.get(f"{server}/d/pbmc3k.cxg/api/v0.2/config").json()
|
||||
userinfo = session.get(f"{server}/d/pbmc3k.cxg/api/v0.2/userinfo").json()
|
||||
self.assertFalse(userinfo["userinfo"]["is_authenticated"])
|
||||
|
||||
Reference in New Issue
Block a user