(owner: string)
| 37 | export function organizationAccessDenialErrorCode(error: unknown): string | null { |
| 38 | if (!(error instanceof TRPCError) || error.code !== 'UNAUTHORIZED') return null; |
| 39 | if (error.message === 'You do not have access to this organization') { |
| 40 | return 'organization_access_required'; |
| 41 | } |
| 42 | return 'permission_required'; |
| 43 | } |
| 44 | |
| 45 | type AuthenticatedOAuthUser = User; |
| 46 | |
| 47 | /** |
| 48 | * An organization OAuth connect stores a credential, so it is membership-only: |
| 49 | * a staff or support grant never stands in (SUPPORT_NEVER_KEYS), and OAuth |
| 50 | * state never carries staff authority. |
| 51 | */ |
| 52 | export type ResolveConnectOwnerOptions = { |
no outgoing calls
no test coverage detected