The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Update messaging and add exact check for error
Joshen Lim75b1a6edce9e
diff --git a/studio/lib/common/fetch/base.ts b/studio/lib/common/fetch/base.tsindex 4cd461163c2..b82ad3d5c64 100644--- a/studio/lib/common/fetch/base.ts+++ b/studio/lib/common/fetch/base.ts@@ -88,7 +88,7 @@ export function getAccessToken() {}// get param from URL fragment-function getParameterByName(name: string, url?: string) {+export function getParameterByName(name: string, url?: string) {// ignore if server-sideif (typeof window === 'undefined') return ''diff --git a/studio/lib/constants/index.ts b/studio/lib/constants/index.tsindex 6908b4af550..eda02a194b6 100644--- a/studio/lib/constants/index.ts+++ b/studio/lib/constants/index.ts@@ -95,3 +95,7 @@ export const LOG_TYPE_LABEL_MAPPING: { [k: string]: string } = {storage: 'Storage',database: 'Database',}++export const GOTRUE_ERRORS = {+ UNVERIFIED_GITHUB_USER: 'Error sending confirmation mail',+}diff --git a/studio/pages/_app.tsx b/studio/pages/_app.tsxindex c56947d3814..f328cbdb5f9 100644--- a/studio/pages/_app.tsx+++ b/studio/pages/_app.tsx@@ -18,6 +18,8 @@ import { Button, IconX } from '@supabase/ui'import { RootStore } from 'stores'import { StoreProvider } from 'hooks'+import { getParameterByName } from 'lib/common/fetch'+import { GOTRUE_ERRORS } from 'lib/constants'import PageTelemetry from 'components/ui/PageTelemetry'import FlagProvider from 'components/ui/Flag/FlagProvider'@@ -72,11 +74,12 @@ function MyApp({ Component, pageProps }: AppProps) {const router = useRouter()useEffect(() => {- if (router.asPath.includes('error_description')) {+ const errorDescription = getParameterByName('error_description', router.asPath)+ if (errorDescription === GOTRUE_ERRORS.UNVERIFIED_GITHUB_USER) {rootStore.ui.setNotification({category: 'error',message:- 'Please verify your email on Github first before logging in to the Supabase dashboard',+ 'Please verify your email on Github first, then reach out to us at [email protected] to log into the dashboard',})}}, [])