Skip to content

Getting req.user as null after logging in via GraphQL from client. #1881

Answered by jmikrut
itzaks asked this question in Q&A
Discussion options

You must be logged in to vote

HEy @itzaks

Couple clarifying things for ya quick:

I believe you should only need to specify credentials: 'include' on fetches if you are relying on Payload's HTTP-only cookie to authenticate.

But if you are specifying the Authorization header directly, that will override the HTTP cookie. So it seems to me like you might be trying to do both here.

Anyway, that's just background info.

I just tried to recreate your issue on the Payload demo (https://demo.payloadcms.com/api/graphql-playground) but I can't. I even used Postman to run a meUser directly from the demo's GraphQL endpoint.

I expect something else is amiss here, and it's just a small issue with your setup. If you can create a min…

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@itzaks
Comment options

@jmikrut
Comment options

@itzaks
Comment options

@itzaks
Comment options

Answer selected by itzaks
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #1876 on January 15, 2023 13:49.