Skip to content

Commit

Permalink
fix(sub): sub replaced with uuid / separate field for pennkey (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
esinx committed Sep 1, 2024
1 parent b4b5781 commit e23ed40
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion backend/accounts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class User(AbstractUser):

@property
def id(self):
return self.username
return self.uuid

def get_preferred_name(self):
if self.preferred_name != "":
Expand Down
2 changes: 2 additions & 0 deletions backend/accounts/oauth2_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class LabsOAuth2Validator(OAuth2Validator):
{
"name": "read",
"email": "read",
"pennkey": "read",
"pennid": "read",
"is_staff": "read",
"is_active": "read",
Expand All @@ -17,6 +18,7 @@ def get_additional_claims(self, request):
return {
"name": request.user.preferred_name or request.user.get_full_name(),
"email": request.user.get_email(),
"pennkey": request.user.username,
"pennid": request.user.pennid,
"is_staff": request.user.is_staff,
"is_active": request.user.is_active,
Expand Down

0 comments on commit e23ed40

Please sign in to comment.