Skip to content

Commit

Permalink
login: add error handling for missing env variable
Browse files Browse the repository at this point in the history
Signed-off-by: Vallari Agrawal <[email protected]>
  • Loading branch information
VallariAg committed Aug 21, 2023
1 parent 13bd9e1 commit 0de643c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/routes/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ async def github_login():
GET route for /login, (If first time) will redirect to github login page
where you should authorize the app to gain access.
"""
if not GH_AUTHORIZATION_BASE_URL or not GH_CLIENT_ID:
return HTTPException(status_code=500, detail="Environment secrets are missing.")
scope = "read:org"
return RedirectResponse(
f"{GH_AUTHORIZATION_BASE_URL}?client_id={GH_CLIENT_ID}&scope={scope}",
Expand Down

0 comments on commit 0de643c

Please sign in to comment.