Let's say your website is w1.example.com & w2.exam...
# support-questions-legacy
r
Let's say your website is w1.example.com & w2.example.com. Your login site is login.example.com You would need an API domain like api.example.com. This would talk to the supertokens core. Now when the user logs in, the form will call the sign in POST API in
api.example.com
. This API is provided by the supertokens-node SDK. On success, it would create an access and a refresh token, and associate them with
api.example.com
. The frontend SDK (supertokens-auth-react) would also add a few cookies on
.example.com
, which can be used to determine if a session exists on
w1.example.com
and
w2.example.com
. Then in
w1.example.com
, on the client side, you would need to check if a session exists, and render appropriate content. Likewise for
w2.example.com
. Finally, you can add any role to the access token which can be read on w1 or w2.example.com, on the client side. This implies that netlify would not be involved in checking for a JWT. Your client side code needs to do that via the supertokens-auth-react SDK. We have a
doesSessionExist()
function that can be used for this.
4 Views