rp
01/27/2022, 5:11 PMsignIn
, signUp
etc so that you don't have to make API calls manually.miguelcobain
01/27/2022, 5:20 PM/auth/signin
with rid: 'emailpassword'
header.
I do get back a 200 with the json and the tokens in the set-cookie response headers.
However, I'm a bit lost on what I should do after that. More specifically, await SuperTokens.doesSessionExist()
returns false.rp
01/27/2022, 5:22 PMmiguelcobain
01/27/2022, 5:24 PMjs
SuperTokens.init({
apiBasePath: '/api/auth',
apiDomain: 'https://my.website.com'
});
Backend config:
js
supertokens.init({
framework: 'fastify',
supertokens: {
connectionURI: process.env.SUPERTOKENS_URL,
apiKey: process.env.SUPERTOKENS_API_KEY
},
appInfo: {
appName: 'My Website',
apiDomain: 'https://my.website.com',
websiteDomain: 'https://my.website.com',
apiGatewayPath: '/api'
},
recipeList: [
EmailPassword.init(),
Session.init({
jwt: {
enable: true
}
})
]
});
rp
01/27/2022, 5:25 PMapiBasePath
on the backend as well.rp
01/27/2022, 5:25 PM/api/auth
. And you can remove apiGatewayPath
(unless you are using something like AWS's staging environment.miguelcobain
01/27/2022, 5:26 PMhttps://my.website.com/api
, which means that supertokens endpoints are at https://my.website.com/api/auth
rp
01/27/2022, 5:27 PMapiBasePath
on both frontend and backend to /api/auth
rp
01/27/2022, 5:27 PMapiGatewayPath
rp
01/27/2022, 5:27 PMmiguelcobain
01/27/2022, 5:31 PMhttps://my.website.com/api/api/auth
miguelcobain
01/27/2022, 5:31 PMapiGatewayPath
.miguelcobain
01/27/2022, 5:33 PMapiGatewayPath
as well, but I don't think that's an option.rp
01/27/2022, 5:48 PMappInfo: {
appName: 'My Website',
apiDomain: 'https://my.website.com',
websiteDomain: 'https://my.website.com',
apiBasePath: '/api/auth',
},
Will expose the APIs on https://my.website.com/api/auth
miguelcobain
01/27/2022, 5:48 PMrp
01/27/2022, 5:48 PM/api
partmiguelcobain
01/27/2022, 5:48 PMrp
01/27/2022, 5:48 PM/auth
rp
01/27/2022, 5:48 PMmiguelcobain
01/27/2022, 5:49 PMhttps://my.website.com/api
is an nginx reverse proxy.rp
01/27/2022, 5:49 PMrp
01/27/2022, 5:49 PMharshit
01/27/2022, 5:51 PMrp
01/27/2022, 5:52 PMharshit
01/27/2022, 5:54 PMrp
01/27/2022, 5:54 PMharshit
01/27/2022, 5:55 PMrp
01/27/2022, 5:55 PMrp
01/27/2022, 5:56 PMrp
01/27/2022, 5:56 PM