Luca
08/15/2022, 3:30 PMwebsite_domain
in supertokens.init
(on backend)? I have multiple frontends that use the same api. And what should i provide to website_domain if i am using a mobile App which has no domain?rp_st
08/15/2022, 3:35 PMrp_st
08/15/2022, 3:36 PMLuca
08/15/2022, 3:39 PMrp_st
08/15/2022, 3:40 PMrp_st
08/15/2022, 3:40 PMLuca
08/15/2022, 3:40 PMrp_st
08/15/2022, 3:41 PMrp_st
08/15/2022, 3:46 PMdomain1.com
(doesn't really matter though)
2) set the cookieSameSite
config in the Session.init()
to be "none"
- this will allow sharing of cookies cross domain.
3) override the emailDelivery
config in ThirdPartyEmailPassword to change the password reset's and email verification's link's URL to point to the right domain based on the origin of the request. You can get the origin of the request from the userContext
input variable in the function. See this: https://supertokens.com/docs/thirdpartyemailpassword/email-delivery/custom-method
Finally, setting sameSite for cookie to none
will have the issue that it won't work on safari when domain2.com queries api.domain1.com. The best way to solve this is to setup a reverse proxy for each of the frontends so that the base domain they query is the same. For example, domain2.com should query api.domain2.com as well (api.domain2.com may point to the same IP address as api.domain1.com).
For mobile apps, if you want to enable deep linking, then when you override the emailDelivery config, then you can change the domain in the URL to be the deep link for your mobile app.Luca
08/15/2022, 3:48 PMrp_st
08/15/2022, 3:49 PMrp_st
08/15/2022, 3:50 PMLuca
08/15/2022, 3:54 PMrp_st
08/15/2022, 3:58 PMrp_st
08/15/2022, 3:58 PMLuca
08/15/2022, 4:01 PMLuca
08/15/2022, 4:01 PMrp_st
08/15/2022, 4:12 PM