mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-15 12:47:56 +08:00
Add user email to the userinfo response (#1862)
We are planning to display the user's email address in the front end. #1830
This commit is contained in:
@@ -308,7 +308,8 @@ class AppConfig(object):
|
||||
userinfo["userinfo"] = {
|
||||
"is_authenticated": auth.is_user_authenticated(),
|
||||
"username": auth.get_user_name(),
|
||||
"user_id": auth.get_user_id()
|
||||
"user_id": auth.get_user_id(),
|
||||
"email": auth.get_user_email()
|
||||
}
|
||||
return userinfo
|
||||
else:
|
||||
|
||||
@@ -122,6 +122,7 @@ class AuthTest(unittest.TestCase):
|
||||
userinfo = session.get(f"{server}/d/pbmc3k.cxg/api/v0.2/userinfo").json()
|
||||
self.assertTrue(userinfo["userinfo"]["is_authenticated"])
|
||||
self.assertEqual(userinfo["userinfo"]["username"], "fake_user")
|
||||
self.assertEqual(userinfo["userinfo"]["email"], "fake_user@email.com")
|
||||
self.assertTrue(config["config"]["parameters"]["annotations"])
|
||||
|
||||
if cookie_key:
|
||||
|
||||
Reference in New Issue
Block a user