Get cookies in `/lib`
Answered
Xander posted this in #help-forum
XanderOP
I have a
How can I get my auth cookie from within here?
/lib/api/fetch.ts
class that is responsible for fetching external api requests.How can I get my auth cookie from within here?
10 Replies
XanderOP
this is intended to be called server side
but of course i get this
do you import this file in any client components?
@joulev do you import this file in any client components?
XanderOP
well components are client only if you put 'use client' right?
in that case no
only one component, and a server action
that's weird...
could you make a minimal reproduction repository?
XanderOP
adding an explicit use server to it worked
Answer
XanderOP
i dont have time for reproductions its a commissioned project with a deadline sorry :/