providers/oauth2: cast user.pk to string when using it for token 'sub' value (#4570)

This commit is contained in:
Ellis Percival 2023-01-30 15:38:10 +00:00 committed by GitHub
parent 5044f8ce6d
commit eb60bba0d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -487,7 +487,7 @@ class RefreshToken(SerializerModel, ExpiringModel, BaseGrantModel):
if self.provider.sub_mode == SubModes.HASHED_USER_ID: if self.provider.sub_mode == SubModes.HASHED_USER_ID:
sub = user.uid sub = user.uid
elif self.provider.sub_mode == SubModes.USER_ID: elif self.provider.sub_mode == SubModes.USER_ID:
sub = user.pk sub = str(user.pk)
elif self.provider.sub_mode == SubModes.USER_EMAIL: elif self.provider.sub_mode == SubModes.USER_EMAIL:
sub = user.email sub = user.email
elif self.provider.sub_mode == SubModes.USER_USERNAME: elif self.provider.sub_mode == SubModes.USER_USERNAME: