Skip to content

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

chore: update org not found message to not collide w/ auth.js (#47192)

Ali Waseem50989ac999f9
diff --git a/apps/studio/components/interfaces/App/RouteValidationWrapper.tsx b/apps/studio/components/interfaces/App/RouteValidationWrapper.tsx
index bb416823fcd..4e0c9382d2f 100644
--- a/apps/studio/components/interfaces/App/RouteValidationWrapper.tsx
+++ b/apps/studio/components/interfaces/App/RouteValidationWrapper.tsx
@@ -68,7 +68,7 @@ export const RouteValidationWrapper = ({ children }: PropsWithChildren<{}>) => {
if (!isValidOrg) {
toast.error('You do not have access to this organization')
- router.push(`${DEFAULT_HOME}?error=org_not_found&org=${slug}`)
+ router.push(DEFAULT_HOME)
return
}
}
diff --git a/apps/studio/pages/organizations.tsx b/apps/studio/pages/organizations.tsx
index 98fb524116e..8ea61cabe20 100644
--- a/apps/studio/pages/organizations.tsx
+++ b/apps/studio/pages/organizations.tsx
@@ -1,11 +1,9 @@
-import { useParams } from 'common'
import { Plus, Search } from 'lucide-react'
import Head from 'next/head'
import Link from 'next/link'
import { useRouter } from 'next/router'
import { useEffect, useState } from 'react'
import { Button, Skeleton } from 'ui'
-import { Admonition } from 'ui-patterns/admonition'
import { Input } from 'ui-patterns/DataInputs/Input'
import { NoOrganizationsState } from '@/components/interfaces/Home/ProjectList/EmptyStates'
@@ -27,8 +25,6 @@ const OrganizationsPage: NextPageWithLayout = () => {
const router = useRouter()
const { appTitle } = useCustomContent(['app:title'])
const [search, setSearch] = useState('')
- const { error: orgNotFoundError, org: orgSlug } = useParams()
- const orgNotFound = orgNotFoundError === 'org_not_found'
const pageTitle = buildStudioPageTitle({
section: 'Organizations',
brand: appTitle || 'Supabase',
@@ -52,8 +48,7 @@ const OrganizationsPage: NextPageWithLayout = () => {
useEffect(() => {
// If there are no organizations, force the user to create one
- // unless the user is on the not found page
- if (isSuccess && organizations.length <= 0 && !orgNotFound) {
+ if (isSuccess && organizations.length <= 0) {
router.push('/new')
}
}, [isSuccess, organizations])
@@ -66,20 +61,6 @@ const OrganizationsPage: NextPageWithLayout = () => {
</Head>
<ScaffoldContainer>
<ScaffoldSection isFullWidth className="flex flex-col gap-y-4">
- {orgNotFound && (
- <Admonition
- type="destructive"
- title="Organization not found"
- description={
- <>
- The organization <code className="text-code-inline">{orgSlug}</code> does not
- exist or you do not have permission to access to it. Contact the the owner if you
- believe this is a mistake.
- </>
- }
- />
- )}
-
{organizations.length > 0 && (
<div className="flex items-center justify-between gap-x-2 md:gap-x-3">
<Input