From ca9b5f1aafee95f31bb4995145efc50da452a955 Mon Sep 17 00:00:00 2001 From: Matias Vallejos Date: Tue, 30 Jan 2024 13:50:13 -0300 Subject: [PATCH] Fix views google auth --- app/auth_api/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/auth_api/views.py b/app/auth_api/views.py index 91597d1..64fde90 100644 --- a/app/auth_api/views.py +++ b/app/auth_api/views.py @@ -1,6 +1,8 @@ from rest_framework.views import APIView from rest_framework import permissions +import os + from allauth.socialaccount.providers.google.views import GoogleOAuth2Adapter from allauth.socialaccount.providers.oauth2.client import OAuth2Client from dj_rest_auth.registration.views import SocialLoginView @@ -10,7 +12,7 @@ class GoogleLoginView(SocialLoginView): # Authorization Code grant adapter_class = GoogleOAuth2Adapter - callback_url = "http://localhost:3000/api/auth/callback/google" + callback_url = f"{os.environ.get("BASE_URL", 'http://localhost:3000')}/api/auth/callback/google" client_class = OAuth2Client