Skip to content

Commit

Permalink
different error message...
Browse files Browse the repository at this point in the history
  • Loading branch information
codekansas committed Jul 25, 2024
1 parent 3077112 commit fec8f8d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion store/app/routers/auth/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ async def github_code(

headers = {"Accept": "application/json"}
oauth_response = await github_access_token_req(params, headers)
if not oauth_response.is_success or "error" in (response_json := oauth_response.json()):
if not oauth_response.is_success:
raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED, detail="Github authentication failed")
if "access_token" not in (response_json := oauth_response.json()):
raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED, detail="Token not found in response from Github")

# access token is used to retrieve user oauth details
access_token = response_json["access_token"]
Expand Down

0 comments on commit fec8f8d

Please sign in to comment.