Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

use `location.origin` for preview env auth redirects

Jonathan Summers-Muir9709eff1389d
diff --git a/studio/components/interfaces/SignIn/ForgotPasswordForm.tsx b/studio/components/interfaces/SignIn/ForgotPasswordForm.tsx
index 31e17a11be9..9f3d1f75d8d 100644
--- a/studio/components/interfaces/SignIn/ForgotPasswordForm.tsx
+++ b/studio/components/interfaces/SignIn/ForgotPasswordForm.tsx
@@ -35,7 +35,7 @@ const ForgotPasswordForm = () => {
hcaptchaToken: token ?? undefined,
redirectTo: `${
process.env.NEXT_PUBLIC_VERCEL_ENV === 'preview'
- ? `https://${process.env.NEXT_PUBLIC_VERCEL_URL}`
+ ? location.origin
: process.env.NEXT_PUBLIC_SITE_URL
}${BASE_PATH}/reset-password`,
})
diff --git a/studio/components/interfaces/SignIn/SignInSSOForm.tsx b/studio/components/interfaces/SignIn/SignInSSOForm.tsx
index 24c7abd27ac..3d1585c0e57 100644
--- a/studio/components/interfaces/SignIn/SignInSSOForm.tsx
+++ b/studio/components/interfaces/SignIn/SignInSSOForm.tsx
@@ -36,7 +36,7 @@ const SignInSSOForm = () => {
captchaToken: token ?? undefined,
redirectTo: `${
process.env.NEXT_PUBLIC_VERCEL_ENV === 'preview'
- ? `https://${process.env.NEXT_PUBLIC_VERCEL_URL}`
+ ? location.origin
: process.env.NEXT_PUBLIC_SITE_URL
}${BASE_PATH}${getReturnToPath()}`,
},
diff --git a/studio/components/interfaces/SignIn/SignInWithGitHub.tsx b/studio/components/interfaces/SignIn/SignInWithGitHub.tsx
index d6cad1da894..a34d53a49b1 100644
--- a/studio/components/interfaces/SignIn/SignInWithGitHub.tsx
+++ b/studio/components/interfaces/SignIn/SignInWithGitHub.tsx
@@ -22,7 +22,7 @@ const SignInWithGitHub = () => {
options: {
redirectTo: `${
process.env.NEXT_PUBLIC_VERCEL_ENV === 'preview'
- ? `https://${process.env.NEXT_PUBLIC_VERCEL_URL}`
+ ? location.origin
: process.env.NEXT_PUBLIC_SITE_URL
}${BASE_PATH}${getReturnToPath()}`,
},
diff --git a/studio/components/interfaces/SignIn/SignUpForm.tsx b/studio/components/interfaces/SignIn/SignUpForm.tsx
index ab6995ad9a9..8940445e12d 100644
--- a/studio/components/interfaces/SignIn/SignUpForm.tsx
+++ b/studio/components/interfaces/SignIn/SignUpForm.tsx
@@ -42,7 +42,7 @@ const SignUpForm = () => {
hcaptchaToken: token ?? null,
redirectTo: `${
process.env.NEXT_PUBLIC_VERCEL_ENV === 'preview'
- ? `https://${process.env.NEXT_PUBLIC_VERCEL_URL}`
+ ? location.origin
: process.env.NEXT_PUBLIC_SITE_URL
}${BASE_PATH}/sign-in`,
})