Skip to content

Commit

Permalink
fix(model): 🐛 udpate get_auth method
Browse files Browse the repository at this point in the history
  • Loading branch information
kikkomep committed Aug 29, 2024
1 parent 43d62b7 commit 846134f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lifemonitor/api/models/registries/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,9 @@ def get_authorization(self, user: auth_models.User, method: str = 'get'):
identity = user.oauth_identity.get(self.server_credentials.client_name, None)
if identity:
token = identity.fetch_token()
auths.append(auth_models.ExternalServiceAuthorizationHeader(user, f"{token['token_type']} {identity.token['access_token']}"))
auth = auth_models.ExternalServiceAuthorizationHeader(f"{token['token_type']} {token['access_token']}")
user.authorizations.append(auth)
auths.append(auth)
else:
logger.warning(f"No '{self.server_credentials.name}' identity for the user {user}")
return auths
Expand Down

0 comments on commit 846134f

Please sign in to comment.