Hey there I am trying to sign up and sign in an us...
# support-questions-legacy
n
Hey there I am trying to sign up and sign in an user programmatically and I kind of fail to receive the
set-cookie
header with curl. These are the commands I am using: SignUp
Copy code
curl http://localhost:3567/recipe/signup \
  -X POST \
  -H 'rid: session' \
  -H 'content-type: application/json' \
  -d '{"email": "main@localhost", "password": "ilikebigturtlesandicannotlie47"}' \
    -i
SignIn
Copy code
curl http://localhost:3567/recipe/signin \
  -X POST \
  -H 'rid: session' \
  -H 'content-type: application/json' \
  -d '{"email": "main@localhost", "password": "ilikebigturtlesandicannotlie47"}' \
    -i
Response from SignIn
Copy code
HTTP/1.1 200 
Content-Type: application/json;charset=UTF-8
Content-Length: 121
Date: Tue, 23 Aug 2022 09:49:01 GMT

{"status":"OK","user":{"email":"main@localhost","id":"cdb5c5ff-605f-4c11-baf8-147a839ce953","timeJoined":1661247992543}}
According to the swagger definitions (https://app.swaggerhub.com/apis/supertokens/FDI/1.14.0#/EmailPassword%20Recipe/signUp), there should be a
set-cookie
header? Am I missing something obvious here? Also figuring out that
/{apiBasePath}/
should be
/recipe
took me quite a while, is this even correct?
r
hey! You are querying the core. The core doesn't return the cookies.
You need to query the backend SDK APIs which are in the FDI swagger spec above
(the one you linked to)
those will return the cookies
n
So what the the default
/{apiBasePath}/
value?
r
default is /auth
so you want to query
n
http://localhost:3567/signin
yields 404 not found
r
thats the location of the core
you want to query your api
n
ohhh, I wanted to query supertokens directly
the supertokens service - because we dont run next.js for the integration tests...
r
but the above will not set cookies
cause the cookie setting part happens in the backend SDK
which integrates with your backend api
n
So it is
/recipe/signin
?
Okay I think I figured it out now.
r
yes. Which the backend SDK does on its own. But since you are not querying that, you need to call that from the core.
n
Is the
sAccessToken
cookie on the incoming request sufficient for retrieving the session via ( the supertokens-node SDKs
Session.getSession
) or are all the cookie values being set mandatory? (sIdRefreshToken, sFrontToken)
r
sAccesToken and sIdRefreshToken (not the refresh token)
n
Okay next problem, cookie seems to be parsed - Now I get the folowing error on the API:
Copy code
No SuperTokens core available to query
Does this mean the API cannot reach the supertokens backend?
oh my god... nevermind
I used the wrong host 🤦‍♂️
r
Hehe! Fair enough
n
All working now thank you! 🥳
r
nice!
3 Views