Spaces:
Runtime error
Runtime error
Update service/auth_service.py
Browse files- service/auth_service.py +4 -10
service/auth_service.py
CHANGED
|
@@ -56,20 +56,14 @@ class AuthService:
|
|
| 56 |
@staticmethod
|
| 57 |
def get_google_oauth_url(redirect_to: str = None):
|
| 58 |
try:
|
| 59 |
-
#
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
# If redirect_to is 'digital-billboard://', we bake it into the callback URL
|
| 63 |
-
# so it comes back to us in the 'google_callback' function later.
|
| 64 |
-
if redirect_to:
|
| 65 |
-
computed_callback = f"{base_callback}?final_dest={redirect_to}"
|
| 66 |
-
else:
|
| 67 |
-
computed_callback = base_callback
|
| 68 |
|
| 69 |
response = supabase.auth.sign_in_with_oauth({
|
| 70 |
"provider": "google",
|
| 71 |
"options": {
|
| 72 |
-
"redirect_to":
|
| 73 |
}
|
| 74 |
})
|
| 75 |
return response.url
|
|
|
|
| 56 |
@staticmethod
|
| 57 |
def get_google_oauth_url(redirect_to: str = None):
|
| 58 |
try:
|
| 59 |
+
# If the app sends a custom redirect (like our mobile scheme), use it DIRECTLY.
|
| 60 |
+
# Otherwise, fall back to the backend callback (which handles the Vercel web logic).
|
| 61 |
+
target_redirect = redirect_to if redirect_to else "https://hammad712-digitalbillboard.hf.space/auth/callback"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
|
| 63 |
response = supabase.auth.sign_in_with_oauth({
|
| 64 |
"provider": "google",
|
| 65 |
"options": {
|
| 66 |
+
"redirect_to": target_redirect
|
| 67 |
}
|
| 68 |
})
|
| 69 |
return response.url
|