Skip to content

Commit

Permalink
Feat: add account type to groups list in providers
Browse files Browse the repository at this point in the history
  • Loading branch information
Rotheem committed Nov 26, 2024
1 parent de96bcd commit 9227c3b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions app/utils/auth/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,8 @@ def get_userinfo(cls, user: models_core.CoreUser):
nickname=user.nickname,
),
# TODO: should we use group ids instead of names? It would be less human readable but would guarantee uniqueness. Question: are group names unique?
"groups": [
group.name for group in user.groups
], # We may want to filter which groups are provided as they won't always all be useful
# We may want to filter which groups are provided as they won't always all be useful
"groups": [group.name for group in user.groups] + [user.account_type.value],
"email": user.email,
"picture": f"https://hyperion.myecl.fr/users/{user.id}/profile-picture",
"is_admin": is_user_member_of_an_allowed_group(user, [GroupType.admin]),
Expand Down Expand Up @@ -183,7 +182,7 @@ def get_userinfo(self, user: models_core.CoreUser) -> dict[str, Any]:
name=user.name,
nickname=user.nickname,
),
"groups": [group.name for group in user.groups],
"groups": [group.name for group in user.groups] + [user.account_type.value],
"email": user.email,
}

Expand Down Expand Up @@ -223,7 +222,7 @@ def get_userinfo(cls, user: models_core.CoreUser):
nickname=user.nickname,
),
"email": user.email,
"groups": [group.name for group in user.groups],
"groups": [group.name for group in user.groups] + [user.account_type.value],
}


Expand Down

0 comments on commit 9227c3b

Please sign in to comment.