teja
01/25/2022, 6:47 AMrp
01/25/2022, 6:50 AMrp
01/25/2022, 6:50 AMteja
01/25/2022, 6:52 AMrp
01/25/2022, 6:52 AMteja
01/25/2022, 6:54 AMrp
01/25/2022, 6:55 AMrajhans84
01/26/2022, 2:15 AMrajhans84
01/26/2022, 2:26 AMmiguelcobain
01/26/2022, 11:05 PMconnectionURI: 'https://example.com/supertokens/'
, but it seems like my backend is trying to make requests like https://example.com/apiversion
.
Does supoertokens support using a base path/prefix for the connectionURI? Seems like it is ignored.rp
01/27/2022, 4:28 AMmiguelcobain
01/27/2022, 5:09 PMrp
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 PM/auth