You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Built a custom login endpoint. For this endpoint I have graphql resolver that uses the localApi to login a user. However, I now need to set the cookie in the response. According to the documentation, res is available through the context and could even be passed to payload.login to automatically set the cookie.
Unfortunately, res does not seem to exist on context, and I have not found a way to get access to it. All ways and accepted answers seem to no longer be working in the current version.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Built a custom login endpoint. For this endpoint I have graphql resolver that uses the localApi to login a user. However, I now need to set the cookie in the response. According to the documentation,
res
is available through thecontext
and could even be passed topayload.login
to automatically set the cookie.Unfortunately,
res
does not seem to exist oncontext
, and I have not found a way to get access to it. All ways and accepted answers seem to no longer be working in the current version.References:
#9829
https://payloadcms.com/docs/graphql/extending#resolver-function
Beta Was this translation helpful? Give feedback.
All reactions