diff --git a/apps/studio/components/layouts/APIAuthorizationLayout.tsx b/apps/studio/components/layouts/APIAuthorizationLayout.tsx
index 59c16b0d295..80265cd0a12 100644
--- a/apps/studio/components/layouts/APIAuthorizationLayout.tsx
+++ b/apps/studio/components/layouts/APIAuthorizationLayout.tsx
@@ -1,5 +1,6 @@
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'
@@ -29,17 +30,19 @@ export const APIAuthorizationLayout = ({
- Supabase
-
+
+ Supabase
+
+
diff --git a/apps/studio/data/partners/stripe-projects-confirm-mutation.ts b/apps/studio/data/partners/stripe-projects-confirm-mutation.ts
index e0ba1a55615..dbc5a55e71f 100644
--- a/apps/studio/data/partners/stripe-projects-confirm-mutation.ts
+++ b/apps/studio/data/partners/stripe-projects-confirm-mutation.ts
@@ -6,22 +6,16 @@ import type { ResponseError, UseCustomMutationOptions } from '@/types'
type ConfirmAccountRequestVariables = {
arId: string
- organizationId?: number
- organizationName?: string
}
-async function confirmAccountRequest({
- arId,
- organizationId,
- organizationName,
-}: ConfirmAccountRequestVariables) {
+async function confirmAccountRequest({ arId }: ConfirmAccountRequestVariables) {
if (!arId) throw new Error('Account request ID is required')
const { data, error } = await post(
'/platform/stripe/projects/provisioning/account_requests/{id}/confirm',
{
params: { path: { id: arId } },
- body: { organization_id: organizationId, organization_name: organizationName },
+ body: {},
}
)
diff --git a/apps/studio/pages/partners/stripe/projects/login.tsx b/apps/studio/pages/partners/stripe/projects/login.tsx
index 5d6ce68d1de..a2099a1a19e 100644
--- a/apps/studio/pages/partners/stripe/projects/login.tsx
+++ b/apps/studio/pages/partners/stripe/projects/login.tsx
@@ -2,41 +2,28 @@ import { useQuery } from '@tanstack/react-query'
import { useParams } from 'common'
import Head from 'next/head'
import { useRouter } from 'next/router'
-import { useEffect, useState } from 'react'
+import { useEffect } from 'react'
import {
Alert_Shadcn_,
AlertDescription_Shadcn_,
AlertTitle_Shadcn_,
Button,
- Input_Shadcn_,
LogoLoader,
WarningIcon,
} from 'ui'
import { APIAuthorizationLayout } from '@/components/layouts/APIAuthorizationLayout'
-import { OrganizationSelector } from '@/components/ui/org-selector'
-import { useOrganizationsQuery } from '@/data/organizations/organizations-query'
import { useConfirmAccountRequestMutation } from '@/data/partners/stripe-projects-confirm-mutation'
-import {
- accountRequestQueryOptions,
- type AccountRequestDetails,
-} from '@/data/partners/stripe-projects-query'
+import { accountRequestQueryOptions } from '@/data/partners/stripe-projects-query'
import { withAuth } from '@/hooks/misc/withAuth'
import { useSignOut } from '@/lib/auth'
-type OrgSummary = NonNullable
-
const StripeProjectsLoginPage = () => {
const router = useRouter()
const { ar_id } = useParams()
const signOut = useSignOut()
- const [selectedOrg, setSelectedOrg] = useState(null)
- const [orgConfirmed, setOrgConfirmed] = useState(false)
- const [creatingNewOrg, setCreatingNewOrg] = useState(false)
- const [newOrgName, setNewOrgName] = useState('')
-
const {
data: accountRequest,
isPending,
@@ -44,10 +31,9 @@ const StripeProjectsLoginPage = () => {
isError,
error,
} = useQuery(accountRequestQueryOptions({ arId: ar_id }))
- const { data: organizations = [] } = useOrganizationsQuery()
const {
- mutateAsync: confirmAccountRequest,
+ mutate: confirmAccountRequest,
isPending: isConfirming,
isSuccess: isConfirmed,
} = useConfirmAccountRequestMutation()
@@ -61,38 +47,19 @@ const StripeProjectsLoginPage = () => {
}
}, [router.isReady, ar_id, router])
- const handleApprove = async (organizationId?: number, organizationName?: string) => {
+ const handleApprove = async () => {
if (!ar_id || isConfirming) return
- confirmAccountRequest({ arId: ar_id, organizationId, organizationName })
+ confirmAccountRequest({ arId: ar_id })
}
- // linked_organization is set when an org is already linked to this Stripe account+org pair
- // userOrgs is the list of user's orgs to pick from (only when no linked org)
const linkedOrg = accountRequest?.linked_organization
- const userOrgs = organizations ?? []
const emailMatches = accountRequest?.email_matches ?? false
- const orgCount = userOrgs.length
-
- // isReauth = org already linked, user is just completing the authorization flow again
- const isReauth = !!linkedOrg
- const isLinking = isReauth || orgCount >= 1
-
- const loadingText = isReauth
- ? 'Completing authorization...'
- : creatingNewOrg || orgCount === 0
- ? 'Creating your organization...'
- : 'Linking your organization...'
- const successTitle = isReauth
- ? 'Authorization Complete'
- : creatingNewOrg || orgCount === 0
- ? 'Organization Created'
- : 'Organization Linked'
- const successDescription = isReauth
+ const loadingText = linkedOrg ? 'Completing authorization...' : 'Creating your organization...'
+ const successTitle = linkedOrg ? 'Authorization Complete' : 'Organization Created'
+ const successDescription = linkedOrg
? null
- : creatingNewOrg || orgCount === 0
- ? 'Your Supabase organization has been created and linked to your Stripe account.'
- : 'Your Supabase organization has been linked to your Stripe account.'
+ : 'Your Supabase organization has been created and linked to your Stripe account.'
return (
@@ -135,7 +102,7 @@ const StripeProjectsLoginPage = () => {
>
) : linkedOrg ? (
- // Org already linked to this Stripe account — inform user, no choice
+ // Org already linked to this Stripe account — inform user and confirm
<>
Your organization {linkedOrg.name} is already linked to your
@@ -146,14 +113,14 @@ const StripeProjectsLoginPage = () => {
size="large"
type="primary"
disabled={isConfirming}
- onClick={() => handleApprove()}
+ onClick={handleApprove}
>
Continue
>
- ) : orgCount === 0 ? (
- // No orgs at all — a new one will be created
+ ) : (
+ // No linked org — a new one will be created
<>
A new Supabase organization will be created and linked to your Stripe account.
@@ -163,133 +130,23 @@ const StripeProjectsLoginPage = () => {
size="large"
type="primary"
disabled={isConfirming}
- onClick={() => handleApprove()}
+ onClick={handleApprove}
>
Approve
>
- ) : creatingNewOrg ? (
- // User chose to create a new org — show name input
- <>
-
- A new Free organization will be created and linked to your Stripe
- account for provisioning Supabase resources.
-
- >
- ) : orgCount === 1 ? (
- // Exactly one org — show its name and option to create new
- <>
-
- Your organization {userOrgs[0].name} will be linked to your
- Stripe account. Supabase resources from Stripe will be provisioned into this
- organization.
-