From 50989ac999f97818a167ce457ccfbdfa3bbb22e2 Mon Sep 17 00:00:00 2001 From: Ali Waseem Date: Wed, 24 Jun 2026 09:10:19 -0600 Subject: [PATCH] chore: update org not found message to not collide w/ auth.js (#47192) ## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## What kind of change does this PR introduce? Error messages were failing due to a error code collision with Auth.js in supabase + gotrue, fix that so the error is not suppressed ## Summary by CodeRabbit ## Release Notes * **Bug Fixes** * Removed the "Organization not found" error message that appeared when navigating to invalid organization slugs. * Streamlined redirect behavior for empty organization lists. --- .../interfaces/App/RouteValidationWrapper.tsx | 2 +- apps/studio/pages/organizations.tsx | 21 +------------------ 2 files changed, 2 insertions(+), 21 deletions(-) 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 = () => { - {orgNotFound && ( - - The organization {orgSlug} 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 && (