getServerSession in middleware
Answered
Saltwater Crocodile posted this in #help-forum
Saltwater CrocodileOP
is it possible to get it? im getting these weird ass errors
Answered by Ray
I think you could fetch the endpoint
fetch(new URL("/api/auth/session", req.url), { headers: Object.fromEntries(req.headers) })6 Replies
@Saltwater Crocodile is it possible to get it? im getting these weird ass errors
no, it uses node api
crypto which is not available in edge runtime@Ray no, it uses node api `crypto` which is not available in edge runtime
Saltwater CrocodileOP
like really no way to get the session object?
@Saltwater Crocodile like really no way to get the session object?
I think you could fetch the endpoint
fetch(new URL("/api/auth/session", req.url), { headers: Object.fromEntries(req.headers) })Answer
Saltwater CrocodileOP
iut works!!!
thanks!!
(it didnt work at first because i forgot its in body :D)