External redirect in SSR loader #868
Unanswered
JonasHiltl
asked this question in
Q&A
Replies: 3 comments
-
I tried to use |
Beta Was this translation helpful? Give feedback.
0 replies
-
hello, Any update ? I got the same error here code used : const protectedRouteProps = {
beforeLoad: async ({context}: { context: Context }) => {
const isAuthenticated = await context.services.authProvider.checkAuth()
if (isAuthenticated) {
return
}
throw redirect({
to: RoutePath.SIGN_IN,
search: {
redirect: location.href,
}
})
},
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
Try with throw redirect({ href: "https://github.com" }) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have setup SSR like the basic-ssr-streaming-file-based example.
I now want to redirect the user to an external auth url inside my root loader if a session cookie doesn't exist.
But I get the error
I don't think that it's currently possible to use
redirect()
with an external url, but is there another way to redirect from inside a loader to an external url?Or would I have to built that into the express api?
Beta Was this translation helpful? Give feedback.
All reactions