From a06bfa2f40b1005a44489ef4f7bfa21ddc570219 Mon Sep 17 00:00:00 2001 From: Syed Ahkam Date: Fri, 22 Sep 2023 00:55:44 +0530 Subject: [PATCH 1/5] fix: small change --- frontend/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/README.md b/frontend/README.md index 965a122..5f61af5 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -1,3 +1,5 @@ +# ThirdEye + This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). ## Getting Started From 4e56536e8367f0fc74f4439cc087c2776ec42de9 Mon Sep 17 00:00:00 2001 From: Syed Ahkam Date: Fri, 22 Sep 2023 01:05:07 +0530 Subject: [PATCH 2/5] fix: small change --- backend/backend/settings.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/backend/settings.py b/backend/backend/settings.py index c69255d..b0eb7f1 100644 --- a/backend/backend/settings.py +++ b/backend/backend/settings.py @@ -312,3 +312,5 @@ {"url": "http://localhost:3000/", "description": "Localhost API base URL"}, ], } + +# Some change From f4d46a25da47faf1d03d4839b72be2dc583f7913 Mon Sep 17 00:00:00 2001 From: Syed Ahkam Date: Fri, 22 Sep 2023 01:28:45 +0530 Subject: [PATCH 3/5] fix: maybe fix oauth --- backend/authentication/views.py | 2 +- backend/backend/settings.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/backend/authentication/views.py b/backend/authentication/views.py index 389c151..8e8b129 100644 --- a/backend/authentication/views.py +++ b/backend/authentication/views.py @@ -164,7 +164,7 @@ def github_login(request): if settings.DEMO_INSTANCE: REPLACEMENT_DOMAIN = settings.API_DOMAIN - # REPLACEMENT_DOMAIN += "/api + REPLACEMENT_DOMAIN += "/api" current_domain = request.get_host() diff --git a/backend/backend/settings.py b/backend/backend/settings.py index b0eb7f1..8cc770b 100644 --- a/backend/backend/settings.py +++ b/backend/backend/settings.py @@ -166,11 +166,10 @@ API_URL = f"http://{API_DOMAIN}/" -FRONTEND_URL_MAIN = "https://thirdeyelabs.xyz/" -FRONTEND_URL_IPFS = "https://ipfs.thirdeyelabs.xyz/" +FRONTEND_URL_MAIN = "https://demo.thirdeyelabs.xyz/" FRONTEND_URL = ( - FRONTEND_URL_IPFS + FRONTEND_URL_MAIN if DEMO_INSTANCE else os.environ.get("FRONTEND_URL", "http://localhost:3000/") ) From b850f45b0f945c3b71bcd412af1e34f979bb26c5 Mon Sep 17 00:00:00 2001 From: Syed Ahkam Date: Fri, 22 Sep 2023 01:36:47 +0530 Subject: [PATCH 4/5] fix: handle edgecase in redirect url --- backend/authentication/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/authentication/views.py b/backend/authentication/views.py index 8e8b129..cc47021 100644 --- a/backend/authentication/views.py +++ b/backend/authentication/views.py @@ -163,8 +163,8 @@ def github_login(request): if settings.DEMO_INSTANCE: REPLACEMENT_DOMAIN = settings.API_DOMAIN - - REPLACEMENT_DOMAIN += "/api" + else: + REPLACEMENT_DOMAIN += "/api" current_domain = request.get_host() From 8c031aa5a2c6a7c920f4be02ed28e5cac6b518be Mon Sep 17 00:00:00 2001 From: Syed Ahkam Date: Fri, 22 Sep 2023 01:45:55 +0530 Subject: [PATCH 5/5] fix: maybe fix --- backend/authentication/views.py | 10 +++++----- backend/backend/settings.py | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/backend/authentication/views.py b/backend/authentication/views.py index cc47021..2f08be1 100644 --- a/backend/authentication/views.py +++ b/backend/authentication/views.py @@ -162,9 +162,9 @@ 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() @@ -172,8 +172,8 @@ def github_login(request): 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) diff --git a/backend/backend/settings.py b/backend/backend/settings.py index 8cc770b..84614a2 100644 --- a/backend/backend/settings.py +++ b/backend/backend/settings.py @@ -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