S
SolidJS11mo ago
Nathan

"Make sure your app is wrapped in a `<Router>`" with Lucia-Auth

I'm trying to move over to Lucia-Auth, and I'm following this guide. I have a routeData function that looks like this:
export const routeData = createServerData$(async (_, event) => {
const authRequest = auth.handleRequest(event.request)
const session = await authRequest.validate()
if (session) {
return redirect("/")
}
})
export const routeData = createServerData$(async (_, event) => {
const authRequest = auth.handleRequest(event.request)
const session = await authRequest.validate()
if (session) {
return redirect("/")
}
})
But it gives me a "Make sure your app is wrapped in a <Router>" error. My app has the usual <FileRoutes /> wrapped in a <Routes> tag, so I'm not sure what the problem is.
1 Reply
Nathan
Nathan11mo ago
Oh, I just needed this to be routeData = () => createServerData$....