Is there any support for next.js `middleware.ts` f...
# support-questions
r
Is there any support for next.js
middleware.ts
file.?? I want to verify the session and redirect users based on that. Note: I am only using Frontend Part of Next.js Guide, For Backend we have a Nest.js Backend
r
hey @Rahat_Rock
at the moment we require the use of
req
and
res
object for verifying the session
i think the middleware doesn't have access to those right?
r
No middleware have access to those, Here is an example of my usage, But this one throws error that I need to init first. but when I init with
supertokensNode.init(backendConfig());
Imported from
supertokens-node
I get this error:
Error: The edge runtime does not support Node.js 'crypto' module.
r
Hmmm I see. Can you open an issue about this on our GitHub? We can check it out sometime in the coming week.
And also how are you running your next app? On vercel or somewhere else?
r
Yupp sure, I'll open an Issue. and I am running on Vercel.
r
Ok thanks. We shall check it out
r
Sweet, Thanks 😄