Custom authentication function accessing cookies / headers. #11998
Unanswered
lukas-mertens
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to implement a custom sso authentication and for that I have to read and validate a cookie. This is what I have got and what I believe should work:
The relevant part is
My problem: headers seems to be empty even though I can validate that it actually does include headers via the browser dev tools, the cookie is there and set correctly. It seems to me as if payloadcms doesn't pass the headers down into access functions via the req object, is that possible? Or how can I access cookies?
The result from the log statements is:
EDIT: I now found out the local api is the problem. The req object passed to my function is created by the createLocalReq of payload cms. How should I approach getting headers in an authenticated function instead?
Beta Was this translation helpful? Give feedback.
All reactions