-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support graphql-request using fetch pollyfills #100
Comments
Hey @jono-allen Just to confirm, you are saying this used to work with supertokens-node 12.1.6? Im clarifying because graphql-requests should have no relation to the backend SDK |
Hey @nkshah2 , Sorry I should also mention that we had our managed ST core upgraded as well, I can't remember what version it was on beforehand but we are now on 5.x. (Think it might have been 3.x) I have switched back to |
Right can you confirm the versions for the following:
If you can please provide versions for when the authenticated requests work and when they don't. Will be really helpful when we try to recreate the issue |
@jono-allen any updates? |
Hey sorry for the delay. Was hoping to put together a example but haven't had time. Should note that we are using supertokens in a monorepo with next.js and expo Here are the version when authenticated requests worked on react-native via graphql-requests
Here are the version when authenticated requests failed on react-native via graphql-requests
Api calls that worked, then did not work using following graphql api request
Solution without using graphql requestsVersions
|
Hey @jono-allen Thanks for the details. Since everything seems to be working with normal fetch its not a bug. We will look into why support for graphql requests broke when moving between versions but since its not a fundamental issue with the SDK itself it will not be a priority for the team. Leaving this issue open, we'll update here when we start making progress on this |
I'm facing this issue too, using The problem was on the web app, it was not being authenticated properly because of the missing cookie. I was able to get around by doing this: SuperTokens.init({
recipeList: [
Passwordless.init({}),
Session.init({
tokenTransferMethod: "header", // This did the trick
}),
],
appInfo: {
// ...
},
}) |
Continuing from https://discord.com/channels/603466164219281420/1084681154013184040/1084927349562286081
Summary
React-native can authenticate using st-react-native but api calls to protected routes do not get cookies or headers attached to perform authenticated requests. This only affects react-native but not web react apps.
The issue:
Using graphql requests on react-native/expo to perform an authenticated fetch to an express server with
supertokens-node
, the fetch calls fails to contain the cookies or headers required to authenticate the request.Using pure "fetch" on react-native, the request passes.
Using
graphql-requests
on withnext.js
the request passes.I tried with whatwg-fetch which also fails.
Tested using
[email protected]
and[email protected]
with[email protected]
Prior to "supertokens-node": "12.1.6"
graphql-requests
would work but after 13.x this no longer worksThe text was updated successfully, but these errors were encountered: