i am making a post request to signinup and i inclu...
# support-questions
b
i am making a post request to signinup and i included all that it needs, but i am still getting an error
r
Hey! Can I see the error and how you are making the request?
b
Copy code
ts
let res = await axios.post(`${url.origin}/api/signinup`, {
    headers: { rid: 'thirdpartyemailpassword', 'Content-Type': 'application/json' },
    body: JSON.stringify({
        code,
        redirectURI: `${url.origin}/callback/${social}`,
        thirdPartyId: social
    })
  });
r
and whats the error?
b
Please provide the thirdPartyId in request body
r
can i see the request body that's sent as shown on the network tab on chrome?
b
i cant find it, weird
i can probably print it
r
yea sure. Print it
b
i cant find it anywhere for some reason
r
well, then print it out before making the request
but i think the value of
social
is undefined
b
it isn't
its
"discord"
r
So can you print the value of the request body somehow?
cause the error indicates that it's missing in the request body
b
i cant find the request body in the response
which is weird
r
im not really sure how to help here without being able to see the actual request body 😅
have you checked the "preserve logs" checkbox in chrome?
b
yes
r
you want to preserve the network requests across page navigations
so the signinup request is not being made at all?
b
the request has to be being made since i'm getting the error
r
yup.. so you need to find it in the network tab
oh wait.. are you using nextjs?
or any sort of server side rendering framework?
b
i am using sveltekit but i disabled ssr
r
hmm
well, if it's really not in the network tab, and the request is being made, then the only explanation is that it's being made from the server side
Can you do a console log before making the request and see if that console log is being printed in the browser console or in the terminal in which you are running the webserver?
b
its in the terminal
r
right. so it is happening in SSR
so you want to make this request only from the frontend and not the server side
b
huh, it should be disabled
r
well..
b
wonder if its only partially off
i can check that
but it might be a bit so i'll keep you up to date
@rp so it was ssr, lol
i got that issue sorted out
i can see the request in the chrome network tab now
r
Ok great!
b
Is there anything wrong with the request?
From what I can tell it's right, but I still get an error
r
What’s the error?
b
Same thing here
r
Huh
So I think the request body is not correctly json stringified
Cause in chrome, you should not see “\” in the request body
b
Hmm weird, I used JSON.stringify
r
Can you google how to send a json request? For axios or fetch (whichever you r using)
And see if there is an error there
b
My code is here, by the way
r
Yea. I think it’s incorrect. You should google how to send axios post request.
b
Oh okay
I'll check that and say if I fixed it later
i fixed that, i got a different error this
which is weird since the status says its successful
You can follow this step by step to get it to work
b
yea thats what i started with
r
right.
Did you add the redirect_uri query param on the authorisation url URL before redirecting the user?
b
yes
r
are you sure that the API is being called just once? That it's not being called from the server side as well?
Cause the code can only be consumed once. If you are calling it twice, then the second call will fail
- Is the redirectURI that's given in the API the same as that put in the query param of the authorisation URL? Is it the same as put on discord's dashboard?
b
its only called once
r
hmm
Can you upload your code on github and share? I'll have a have a look in more detail
r
404
can you add me to the repo?
github username is rishabhpoddar
b
oh woops
i didnt know it was private, yea i'll add you you
r
cool
b
which one?
r
the first one
b
okay
added
r
Does the repo also have the backend code?
If not, can i see the config provided to discord?
r
thanks. Will see
b
okay
r
Can you open an issue about this in the python SDK?
b
before i do that i should probably upgrade incase anything changes
r
you can try to upgrade the SDKs and see
b
actually, since theres a new vanilla js frontend SDK, should i use that instead
r
yea that would make it easier for sure. You don't have to query the APIs yourself.
But the docs for it are not yet there. But I can tell you here
Anyhow, the issue might be in the backend side. That's why i asked you to open an issue
b
okay
alright so i upgraded the python SDK, and when i tested i got this error https://pastebin.com/xJSfcbRN
had to pastebin it because it was too big for discord
r
right yea. So can you open an issue about this in the python SDK? We will get on it rigth away
b
okay
r
thanks
b
you're welcome and thank you
i opened the issue
r
ok thanks
k
Hey @BeeMoe, Regarding https://github.com/supertokens/supertokens-python/issues/202 Could you please recheck the credentials (esp.
clientSecret
)
access_token
related errors are expected to appear if the credentials are wrong.
3 Views