Skip to content

Commit

Permalink
fix mapper
Browse files Browse the repository at this point in the history
  • Loading branch information
devksingh4 committed Oct 19, 2023
1 parent e6e7c03 commit 9ea3092
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions code/mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,18 @@ def getPaidMembership(context, queryParams) -> dict:
'key': 'access_token'
}
)
aad_secret = response['Item']
aad_secret = response['Item']['value']
except:
# We don't have a cached token, got TTL'ed out.
aad_secret = json.loads(client.get_secret_value(SecretId=AAD_SECRET_ID)['SecretString'])
table.put_item(
Item={
'key': {
'M': aad_secret
'S': 'access_token'
},
'value': {
'M': aad_secret
}
'TimeToLive': {
'N': int(time.time()) + TOKEN_VALIDITY_SECONDS
}
Expand Down

0 comments on commit 9ea3092

Please sign in to comment.