Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
anders-kiaer committed Sep 26, 2023
1 parent d890218 commit ad0f831
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions backend/src/backend/auth/auth_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ async def _login_route(self, request: Request, redirect_url_after_login: Optiona
for value in config.RESOURCE_SCOPES_DICT.values():
all_scopes_list.extend(value)

if "CODESPACE_NAME" in os.env:
redirect_uri = f"https://{os.env['CODESPACE_NAME']}-8080.app.github.dev/auth-callback"
if "CODESPACE_NAME" in os.environ:
# Developer is using GitHub codespace, so we use the GitHub codespace provided URL instead of localhost.
redirect_uri = f"https://{os.environ['CODESPACE_NAME']}-8080.app.github.dev/auth-callback"
else:
redirect_uri = f"http://localhost:8080/auth-callback"

Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ services:
- WEBVIZ_SMDA_RESOURCE_SCOPE
- WEBVIZ_SMDA_SUBSCRIPTION_KEY
- WEBVIZ_SUMO_ENV
- CODESPACE_NAME # Automatically set env. variable by GitHub codespace
volumes:
- ./backend/src:/home/appuser/backend/src

Expand Down

0 comments on commit ad0f831

Please sign in to comment.