Luca
09/07/2022, 3:29 PMrp_st
09/07/2022, 3:29 PMrp_st
09/07/2022, 3:30 PMLuca
09/07/2022, 3:31 PM<Route path={'*'} element={<ThirdPartyEmailPasswordAuth>
<ProtectedZone/>
</ThirdPartyEmailPasswordAuth>}
/>
rp_st
09/07/2022, 3:32 PMLuca
09/07/2022, 3:32 PMrp_st
09/07/2022, 3:33 PMLuca
09/07/2022, 3:34 PMrp_st
09/07/2022, 3:35 PMLuca
09/07/2022, 3:36 PMrp_st
09/07/2022, 3:36 PMrp_st
09/07/2022, 3:37 PMrp_st
09/07/2022, 3:37 PMLuca
09/07/2022, 3:38 PMrp_st
09/07/2022, 3:38 PMLuca
09/07/2022, 3:41 PMrp_st
09/07/2022, 3:43 PMrp_st
09/07/2022, 3:44 PMLuca
09/07/2022, 3:44 PMrp_st
09/07/2022, 3:44 PMrp_st
09/07/2022, 3:45 PMLuca
09/07/2022, 3:46 PMrp_st
09/07/2022, 3:46 PMLuca
09/07/2022, 3:47 PMrp_st
09/07/2022, 3:47 PMrp_st
09/07/2022, 3:48 PMLuca
09/07/2022, 3:48 PMsupertokens_python.exceptions.GeneralError: SuperTokens core threw an error for a GET request to path: /apiversion with status code: 401 and message: Invalid API key
rp_st
09/07/2022, 3:48 PMLuca
09/07/2022, 3:49 PMrp_st
09/07/2022, 3:49 PMLuca
09/07/2022, 3:49 PMrp_st
09/07/2022, 3:49 PMrp_st
09/07/2022, 5:27 PMnpm i git+https://github.com:supertokens/supertokens-auth-react.git#next-breaking-change
And then see if the issue still happens.Luca
09/07/2022, 6:03 PMLuca
09/07/2022, 8:00 PMrp_st
09/07/2022, 8:09 PMLuca
09/07/2022, 8:11 PM"supertokens-auth-react": "github:supertokens/supertokens-auth-react#next-breaking-change",
Luca
09/07/2022, 8:11 PMrp_st
09/07/2022, 8:12 PMLuca
09/07/2022, 8:13 PMrp_st
09/07/2022, 8:14 PMporcellus
09/07/2022, 8:20 PMLuca
09/07/2022, 8:23 PMLuca
09/07/2022, 8:23 PMrp_st
09/07/2022, 8:25 PMLuca
09/07/2022, 8:26 PMrp_st
09/07/2022, 8:27 PMLuca
09/07/2022, 8:30 PMporcellus
09/07/2022, 8:32 PMLuca
09/07/2022, 8:32 PMporcellus
09/07/2022, 8:33 PMLuca
09/07/2022, 8:34 PMLuca
09/07/2022, 8:34 PMporcellus
09/07/2022, 8:35 PMrp_st
09/07/2022, 8:35 PMrp_st
09/07/2022, 8:35 PMporcellus
09/07/2022, 8:35 PMrp_st
09/07/2022, 8:40 PMrp_st
09/07/2022, 8:41 PMLuca
09/07/2022, 8:45 PMrp_st
09/07/2022, 8:45 PMLuca
09/07/2022, 8:46 PMrp_st
09/07/2022, 8:48 PMrp_st
09/07/2022, 8:48 PMLuca
09/08/2022, 12:46 PMTypeError: Failed to fetch
Luca
09/08/2022, 12:46 PMrp_st
09/08/2022, 12:46 PMLuca
09/08/2022, 12:48 PMLuca
09/08/2022, 12:49 PMrp_st
09/08/2022, 12:50 PMnpm i git+https://github.com:supertokens/supertokens-auth-react.git#0.25
Luca
09/08/2022, 1:01 PMjavascript
const res = await origFetch(input, init)
const url = input.url || input
if (isApiDomain(url)) {
...
if (url.includes('/auth') && res.status === 500) {
throw new Error('Suppertokens error')
}
}
rp_st
09/08/2022, 1:02 PMrp_st
09/08/2022, 1:03 PMLuca
09/08/2022, 1:04 PMrp_st
09/08/2022, 1:04 PMrp_st
09/08/2022, 1:04 PMrp_st
09/08/2022, 1:04 PMrp_st
09/08/2022, 1:05 PMLuca
09/08/2022, 1:09 PMrp_st
09/08/2022, 1:10 PMrp_st
09/08/2022, 1:31 PMrp_st
09/08/2022, 1:31 PMrp_st
09/08/2022, 1:35 PMLuca
09/08/2022, 1:37 PMrp_st
09/08/2022, 1:38 PMts
class ErrorBoundary extends React.Component<unknown, ErrorBoundaryState> {
constructor(props: { hasError: boolean }) {
super(props);
this.state = { hasError: false };
}
static getDerivedStateFromError(): ErrorBoundaryState {
return { hasError: true };
}
componentDidCatch(error: Error, errorInfo: ErrorInfo): void {
console.info(error, errorInfo);
}
render(): JSX.Element | ReactNode | undefined {
if (this.state.hasError) {
return "Error boundry UI";
}
return this.props.children;
}
}
And wrapped the whole app with this component.rp_st
09/08/2022, 1:38 PMLuca
09/08/2022, 1:40 PMrp_st
09/08/2022, 1:40 PMrp_st
09/08/2022, 1:40 PMLuca
09/08/2022, 1:42 PMLuca
09/08/2022, 1:42 PMLuca
09/08/2022, 1:43 PMporcellus
09/08/2022, 1:44 PMporcellus
09/08/2022, 1:44 PMcomponentDidCatch
and rethrow them if you can't handle the error in a meaningful way (but you'd end up with a white screen anyway)Luca
09/08/2022, 5:56 PM