Skip to content

Commit

Permalink
fix: maybe fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SyedAhkam committed Sep 21, 2023
1 parent b850f45 commit 8c031aa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions backend/authentication/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,18 +162,18 @@ def github_login(request):
REPLACEMENT_DOMAIN = "localhost:3000"

if settings.DEMO_INSTANCE:
REPLACEMENT_DOMAIN = settings.API_DOMAIN
else:
REPLACEMENT_DOMAIN += "/api"
REPLACEMENT_DOMAIN = settings.FRONTEND_DOMAIN

REPLACEMENT_DOMAIN += "/api"

current_domain = request.get_host()

redirect_uri = request.build_absolute_uri(reverse("oauth_github_callback")).replace(
current_domain, REPLACEMENT_DOMAIN
)

# if settings.DEMO_INSTANCE:
# redirect_uri = redirect_uri.replace("http://", "https://")
if settings.DEMO_INSTANCE:
redirect_uri = redirect_uri.replace("http://", "https://")

try:
return oauth.github.authorize_redirect(request, redirect_uri)
Expand Down
3 changes: 2 additions & 1 deletion backend/backend/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@

API_URL = f"http://{API_DOMAIN}/"

FRONTEND_URL_MAIN = "https://demo.thirdeyelabs.xyz/"
FRONTEND_DOMAIN = "demo.thirdeyelabs.xyz"
FRONTEND_URL_MAIN = f"https://{FRONTEND_DOMAIN}/"

FRONTEND_URL = (
FRONTEND_URL_MAIN
Expand Down

0 comments on commit 8c031aa

Please sign in to comment.