``` const router = createBrowserRouter([ ...getS...
# support-questions-legacy
w
Copy code
const 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
            }
          
        },
      }
    ],
  },
])
7 Views