@@ -8,7 +8,6 @@ import {useAuthState} from '../../hooks/auth/useAuthState'
8
8
import { useLoginUrl } from '../../hooks/auth/useLoginUrl'
9
9
import { useVerifyOrgProjects } from '../../hooks/auth/useVerifyOrgProjects'
10
10
import { useSanityInstance } from '../../hooks/context/useSanityInstance'
11
- import { useCorsOriginError } from '../../hooks/errors/useCorsOriginError'
12
11
import { CorsErrorComponent } from '../errors/CorsErrorComponent'
13
12
import { isInIframe } from '../utils'
14
13
import { AuthError } from './AuthError'
@@ -109,38 +108,24 @@ export function AuthBoundary({
109
108
LoginErrorComponent = LoginError ,
110
109
...props
111
110
} : AuthBoundaryProps ) : React . ReactNode {
112
- const { error : corsError , projectId, clear : clearCorsError } = useCorsOriginError ( )
113
-
114
111
const FallbackComponent = useMemo ( ( ) => {
115
112
return function LoginComponentWithLayoutProps ( fallbackProps : FallbackProps ) {
116
113
if ( fallbackProps . error instanceof CorsOriginError ) {
117
114
return (
118
115
< CorsErrorComponent
119
116
{ ...fallbackProps }
120
117
projectId = { getCorsErrorProjectId ( fallbackProps . error ) }
121
- resetErrorBoundary = { ( ) => {
122
- clearCorsError ( )
123
- fallbackProps . resetErrorBoundary ( )
124
- } }
125
118
/>
126
119
)
127
120
}
128
121
return < LoginErrorComponent { ...fallbackProps } />
129
122
}
130
- } , [ LoginErrorComponent , clearCorsError ] )
123
+ } , [ LoginErrorComponent ] )
131
124
132
125
return (
133
126
< ComlinkTokenRefreshProvider >
134
127
< ErrorBoundary FallbackComponent = { FallbackComponent } >
135
- { corsError ? (
136
- < CorsErrorComponent
137
- error = { corsError }
138
- resetErrorBoundary = { ( ) => clearCorsError ( ) }
139
- projectId = { projectId }
140
- />
141
- ) : (
142
- < AuthSwitch { ...props } />
143
- ) }
128
+ < AuthSwitch { ...props } />
144
129
</ ErrorBoundary >
145
130
</ ComlinkTokenRefreshProvider >
146
131
)
0 commit comments