mirror of
https://github.com/supabase/supabase.git
synced 2026-10-07 18:35:07 +03:00
chore: remove unused oauth authorize result types
The AuthorizeResult union and its guards were never wired into the approve flow, so knip reported the file as dead. Reintroduce it alongside the error state that uses it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
8f4445f542
commit
d9d89ffd79
1 file changed
-26
@@ -1,26 +0,0 @@
|
||||
import type { OAuthAppsAuthorizeApproveResponse } from './oauth-apps-authorize-approve-mutation'
|
||||
|
||||
export type ProjectRoleFailure = {
|
||||
projectRef: string
|
||||
projectName: string
|
||||
userRole: string
|
||||
missingScopes: string[]
|
||||
}
|
||||
|
||||
export type AuthorizeResult =
|
||||
| { status: 'success'; data: OAuthAppsAuthorizeApproveResponse }
|
||||
| { status: 'role_validation_failed'; failures: ProjectRoleFailure[] }
|
||||
| { status: 'error'; code: string; message: string }
|
||||
|
||||
export const isAuthorizeSuccess = (
|
||||
result: AuthorizeResult
|
||||
): result is Extract<AuthorizeResult, { status: 'success' }> => result.status === 'success'
|
||||
|
||||
export const isRoleValidationFailure = (
|
||||
result: AuthorizeResult
|
||||
): result is Extract<AuthorizeResult, { status: 'role_validation_failed' }> =>
|
||||
result.status === 'role_validation_failed'
|
||||
|
||||
export const isAuthorizeError = (
|
||||
result: AuthorizeResult
|
||||
): result is Extract<AuthorizeResult, { status: 'error' }> => result.status === 'error'
|
||||
Reference in new issue
Block a user