Skip to content

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

change to static BASE_PATH variable

Alaister Young26db1f054559
diff --git a/studio/components/interfaces/SignIn/ForgotPasswordForm.tsx b/studio/components/interfaces/SignIn/ForgotPasswordForm.tsx
index 60561977e71..309b739a03e 100644
--- a/studio/components/interfaces/SignIn/ForgotPasswordForm.tsx
+++ b/studio/components/interfaces/SignIn/ForgotPasswordForm.tsx
@@ -1,7 +1,7 @@
import HCaptcha from '@hcaptcha/react-hcaptcha'
import { useStore } from 'hooks'
import { post } from 'lib/common/fetch'
-import { API_URL } from 'lib/constants'
+import { API_URL, BASE_PATH } from 'lib/constants'
import { useRouter } from 'next/router'
import { useRef, useState } from 'react'
import { Button, Form, Input } from 'ui'
@@ -14,7 +14,6 @@ const forgotPasswordSchema = object({
const ForgotPasswordForm = () => {
const { ui } = useStore()
const router = useRouter()
- const { basePath } = router
const [captchaToken, setCaptchaToken] = useState<string | null>(null)
const captchaRef = useRef<HCaptcha>(null)
@@ -38,7 +37,7 @@ const ForgotPasswordForm = () => {
process.env.NEXT_PUBLIC_VERCEL_ENV === 'preview'
? `https://${process.env.NEXT_PUBLIC_VERCEL_URL}`
: process.env.NEXT_PUBLIC_SITE_URL
- }${basePath}/reset-password`,
+ }${BASE_PATH}/reset-password`,
})
const error = response.error
diff --git a/studio/components/interfaces/SignIn/SignInSSOForm.tsx b/studio/components/interfaces/SignIn/SignInSSOForm.tsx
index 73134608acd..24c7abd27ac 100644
--- a/studio/components/interfaces/SignIn/SignInSSOForm.tsx
+++ b/studio/components/interfaces/SignIn/SignInSSOForm.tsx
@@ -1,8 +1,8 @@
import HCaptcha from '@hcaptcha/react-hcaptcha'
import { useQueryClient } from '@tanstack/react-query'
import { useStore } from 'hooks'
+import { BASE_PATH } from 'lib/constants'
import { auth, getReturnToPath } from 'lib/gotrue'
-import { useRouter } from 'next/router'
import { useRef, useState } from 'react'
import { Button, Form, Input } from 'ui'
import { object, string } from 'yup'
@@ -13,7 +13,6 @@ const signInSchema = object({
const SignInSSOForm = () => {
const { ui } = useStore()
- const { basePath } = useRouter()
const queryClient = useQueryClient()
const [captchaToken, setCaptchaToken] = useState<string | null>(null)
@@ -39,7 +38,7 @@ const SignInSSOForm = () => {
process.env.NEXT_PUBLIC_VERCEL_ENV === 'preview'
? `https://${process.env.NEXT_PUBLIC_VERCEL_URL}`
: process.env.NEXT_PUBLIC_SITE_URL
- }${basePath}${getReturnToPath()}`,
+ }${BASE_PATH}${getReturnToPath()}`,
},
})
diff --git a/studio/components/interfaces/SignIn/SignInWithGitHub.tsx b/studio/components/interfaces/SignIn/SignInWithGitHub.tsx
index 4d453959ca4..091b2ee750c 100644
--- a/studio/components/interfaces/SignIn/SignInWithGitHub.tsx
+++ b/studio/components/interfaces/SignIn/SignInWithGitHub.tsx
@@ -1,9 +1,8 @@
+import { BASE_PATH } from 'lib/constants'
import { auth, getReturnToPath } from 'lib/gotrue'
-import { useRouter } from 'next/router'
import { Button, IconGitHub } from 'ui'
const SignInWithGitHub = () => {
- const { basePath } = useRouter()
async function handleGithubSignIn() {
try {
const { error } = await auth.signInWithOAuth({
@@ -13,7 +12,7 @@ const SignInWithGitHub = () => {
process.env.NEXT_PUBLIC_VERCEL_ENV === 'preview'
? `https://${process.env.NEXT_PUBLIC_VERCEL_URL}`
: process.env.NEXT_PUBLIC_SITE_URL
- }${basePath}${getReturnToPath()}`,
+ }${BASE_PATH}${getReturnToPath()}`,
},
})
if (error) throw error
diff --git a/studio/components/interfaces/SignIn/SignUpForm.tsx b/studio/components/interfaces/SignIn/SignUpForm.tsx
index 1d1e6affca2..b84ae70b19e 100644
--- a/studio/components/interfaces/SignIn/SignUpForm.tsx
+++ b/studio/components/interfaces/SignIn/SignUpForm.tsx
@@ -5,10 +5,9 @@ import { Alert, Button, Form, IconEye, IconEyeOff, Input } from 'ui'
import { useStore } from 'hooks'
import { post } from 'lib/common/fetch'
-import { API_URL } from 'lib/constants'
+import { API_URL, BASE_PATH } from 'lib/constants'
import { passwordSchema } from 'lib/schemas'
import PasswordConditionsHelper from './PasswordConditionsHelper'
-import { useRouter } from 'next/router'
const signUpSchema = passwordSchema.shape({
email: yup.string().email().required().label('Email'),
@@ -16,7 +15,6 @@ const signUpSchema = passwordSchema.shape({
const SignUpForm = () => {
const { ui } = useStore()
- const { basePath } = useRouter()
const captchaRef = useRef<HCaptcha>(null)
const [showConditions, setShowConditions] = useState(false)
const [isSubmitted, setIsSubmitted] = useState(false)
@@ -43,7 +41,7 @@ const SignUpForm = () => {
process.env.NEXT_PUBLIC_VERCEL_ENV === 'preview'
? `https://${process.env.NEXT_PUBLIC_VERCEL_URL}`
: process.env.NEXT_PUBLIC_SITE_URL
- }${basePath}/sign-in`,
+ }${BASE_PATH}/sign-in`,
})
const error = response.error