I’m working on a Next.js project using the Lucia authentication package, and want to perform session validation in middleware. This is a place where I am stuck.
Any ideas,examples or strategies on how it can be done?
Thanks a lot!
I tried:
1). Server Actions: When I tried to move logic to server-side-only actions, I encountered runtime errors because Edge doesn’t support certain Node.js features.
2). Fetching Routes: Attempts to fetch session validation routes from the middleware consistently return an empty object, which isn’t helpful.