https://supertokens.com/ logo
b

BeeMoe

07/03/2022, 2:38 AM
i am making a post request to signinup and i included all that it needs, but i am still getting an error
r

rp

07/03/2022, 4:24 AM
Hey! Can I see the error and how you are making the request?
b

BeeMoe

07/03/2022, 6:15 AM
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

rp

07/03/2022, 6:15 AM
and whats the error?
b

BeeMoe

07/03/2022, 6:15 AM
Please provide the thirdPartyId in request body
r

rp

07/03/2022, 6:16 AM
can i see the request body that's sent as shown on the network tab on chrome?
b

BeeMoe

07/03/2022, 6:29 AM
i cant find it, weird
i can probably print it
r

rp

07/03/2022, 6:30 AM
yea sure. Print it
b

BeeMoe

07/03/2022, 7:06 AM
i cant find it anywhere for some reason
r

rp

07/03/2022, 7:06 AM
well, then print it out before making the request
but i think the value of
social
is undefined
b

BeeMoe

07/03/2022, 7:07 AM
it isn't
its
"discord"
r

rp

07/03/2022, 7:08 AM
So can you print the value of the request body somehow?
cause the error indicates that it's missing in the request body
b

BeeMoe

07/03/2022, 7:09 AM
i cant find the request body in the response
which is weird
r

rp

07/03/2022, 7:09 AM
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

BeeMoe

07/03/2022, 7:10 AM
yes
r

rp

07/03/2022, 7:10 AM
you want to preserve the network requests across page navigations
so the signinup request is not being made at all?
b

BeeMoe

07/03/2022, 7:11 AM
the request has to be being made since i'm getting the error
r

rp

07/03/2022, 7:11 AM
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

BeeMoe

07/03/2022, 7:14 AM
i am using sveltekit but i disabled ssr
r

rp

07/03/2022, 7:14 AM
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

BeeMoe

07/03/2022, 7:16 AM
its in the terminal
r

rp

07/03/2022, 7:16 AM
right. so it is happening in SSR
so you want to make this request only from the frontend and not the server side
b

BeeMoe

07/03/2022, 7:17 AM
huh, it should be disabled
r

rp

07/03/2022, 7:17 AM
well..
b

BeeMoe

07/03/2022, 7:18 AM
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

rp

07/05/2022, 3:54 AM
Ok great!
b

BeeMoe

07/05/2022, 3:56 AM
Is there anything wrong with the request?
From what I can tell it's right, but I still get an error
r

rp

07/05/2022, 3:57 AM
What’s the error?
b

BeeMoe

07/05/2022, 3:57 AM
Same thing here
r

rp

07/05/2022, 3:57 AM
Huh
So I think the request body is not correctly json stringified
Cause in chrome, you should not see “\” in the request body
b

BeeMoe

07/05/2022, 3:59 AM
Hmm weird, I used JSON.stringify
r

rp

07/05/2022, 3:59 AM
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

BeeMoe

07/05/2022, 4:00 AM
My code is here, by the way
r

rp

07/05/2022, 4:01 AM
Yea. I think it’s incorrect. You should google how to send axios post request.
b

BeeMoe

07/05/2022, 4:01 AM
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

BeeMoe

07/05/2022, 5:45 AM
yea thats what i started with
r

rp

07/05/2022, 5:46 AM
right.
Did you add the redirect_uri query param on the authorisation url URL before redirecting the user?
b

BeeMoe

07/05/2022, 5:47 AM
yes
r

rp

07/05/2022, 5:51 AM
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

BeeMoe

07/05/2022, 5:55 AM
its only called once
r

rp

07/05/2022, 5:59 AM
hmm
Can you upload your code on github and share? I'll have a have a look in more detail
r

rp

07/05/2022, 6:14 AM
404
can you add me to the repo?
github username is rishabhpoddar
b

BeeMoe

07/05/2022, 6:15 AM
oh woops
i didnt know it was private, yea i'll add you you
r

rp

07/05/2022, 6:15 AM
cool
b

BeeMoe

07/05/2022, 6:17 AM
which one?
r

rp

07/05/2022, 6:21 AM
the first one
b

BeeMoe

07/05/2022, 6:22 AM
okay
added
r

rp

07/05/2022, 6:51 AM
Does the repo also have the backend code?
If not, can i see the config provided to discord?
r

rp

07/05/2022, 7:02 AM
thanks. Will see
b

BeeMoe

07/05/2022, 7:02 AM
okay
r

rp

07/05/2022, 7:03 AM
Can you open an issue about this in the python SDK?
b

BeeMoe

07/05/2022, 7:04 AM
before i do that i should probably upgrade incase anything changes
r

rp

07/05/2022, 7:10 AM
you can try to upgrade the SDKs and see
b

BeeMoe

07/05/2022, 7:29 AM
actually, since theres a new vanilla js frontend SDK, should i use that instead
r

rp

07/05/2022, 7:29 AM
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

BeeMoe

07/05/2022, 7:31 AM
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

rp

07/05/2022, 7:42 AM
right yea. So can you open an issue about this in the python SDK? We will get on it rigth away
b

BeeMoe

07/05/2022, 7:42 AM
okay
r

rp

07/05/2022, 7:43 AM
thanks
b

BeeMoe

07/05/2022, 7:43 AM
you're welcome and thank you
i opened the issue
r

rp

07/05/2022, 8:00 AM
ok thanks
k

KShivendu

07/06/2022, 6:01 AM
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