Files
supabase/apps/studio/components/layouts/APIAuthorizationLayout.tsx
T
Raúl BarrosoandIvan Vasilov 1797842ee5 refactor(stripe projects): always create a new org (#44634)
## 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?

Refactor based on https://github.com/supabase/platform/pull/31325

## What is the current behavior?

We presented a page to Stripe users to let them either pick an existing
org or create one.

## What is the new behavior?

We're forcing them to create a new one (or show that there was one
already linked).

- It also adds the option to sign out when there's a conflict. Fixes
https://linear.app/supabase/issue/API-963/add-a-button-to-logout-from-the-page-you-must-be-logged-in-as-x-to
- And adds the link to root from the logo.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
  * Added organization preview creation endpoint for billing workflows.

* **Bug Fixes**
* Removed organization-picking flow from Stripe Projects login; users
now proceed directly with confirmation.
  * Added a "Sign out" button on error pages.

* **Refactor**
  * Removed a legacy billing partner option.
  * Made the Supabase logo clickable for quick navigation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2026-04-08 17:11:28 +00:00

58 lines
1.8 KiB
TypeScript

import { useTheme } from 'next-themes'
import Image from 'next/legacy/image'
import Link from 'next/link'
import type { PropsWithChildren } from 'react'
import { Separator } from 'ui'
import { Head, type HeadProvider } from '@/components/ui/Head'
import { useCustomContent } from '@/hooks/custom-content/useCustomContent'
import { BASE_PATH } from '@/lib/constants'
export interface APIAuthorizationLayoutProps {
HeadProvider: HeadProvider
}
export const APIAuthorizationLayout = ({
HeadProvider,
children,
}: PropsWithChildren<APIAuthorizationLayoutProps>) => {
const { resolvedTheme } = useTheme()
const { appTitle } = useCustomContent(['app:title'])
return (
<>
<Head
HeadProvider={HeadProvider}
title={`Authorize API access | ${appTitle || 'Supabase'}`}
/>
<main className="h-screen flex flex-col w-full h-full overflow-y-auto">
<div>
<div className="mx-auto px-4 sm:px-6">
<div className="max-w-xl flex justify-between items-center mx-auto py-4">
<div className="flex justify-start lg:w-0 lg:flex-1 items-center">
<Link href="/">
<span className="sr-only">Supabase</span>
<Image
src={
resolvedTheme?.includes('dark')
? `${BASE_PATH}/img/supabase-dark.svg`
: `${BASE_PATH}/img/supabase-light.svg`
}
alt="Supabase Logo"
height={20}
width={105}
/>
</Link>
</div>
</div>
</div>
</div>
<Separator />
<div className="flex flex-col justify-center flex-grow mx-auto w-[90vw] max-w-[600px] space-y-4">
{children}
</div>
</main>
</>
)
}