I have a need to use validateRequest() from middleware.ts; but it was throwing an error on the caching in export const getCurrentUser = cache(async () => { with Error [ERR_HTTP_HEADERS_SENT]: Cannot append headers after they are sent to the client the fix is to move the function getSessionToken from session.ts to auth.ts. Hope this helps someone!
I have a need to use
validateRequest()frommiddleware.ts; but it was throwing an error on the caching inexport const getCurrentUser = cache(async () => {withError [ERR_HTTP_HEADERS_SENT]: Cannot append headers after they are sent to the clientthe fix is to move the functiongetSessionTokenfromsession.tstoauth.ts. Hope this helps someone!