willcs40_63396
01/26/2024, 10:21 AMconst router = createBrowserRouter([
...getSuperTokensRoutesForReactRouterDom(reactRouterDom, [ThirdPartyEmailPasswordPreBuiltUI]).map((r) => r.props),
{
path: '/',
element: <Layout />,
children: [
{
path: '/',
element: <Upload />
},
{
path: '/result/:id',
element: <Result />,
loader: async ({ params }) => {
document.title = `R: ${params.id}`
let result
try{
result = await fetchById('/get_result', params.id)
return { result }
} catch (error) {
return redirect('/auth');
//return redirectToAuth(); this shows an error to the user for a second, and the redirect after login gets into a failed loop
}
},
}
],
},
])