Skip to content

Commit

Permalink
Improve error handling for access token
Browse files Browse the repository at this point in the history
  • Loading branch information
dinvlad committed Aug 15, 2020
1 parent 858e1e5 commit bfc30bc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions google_yubikey/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,9 @@ def get_access_token(id_token: str):
'assertion': id_token,
},
)
if not response.ok:
raise RuntimeError(response.json()['error_description'])

return response.json()['access_token']


Expand Down

0 comments on commit bfc30bc

Please sign in to comment.