Subdomain Authentication
Hello,
I am trying to work through a solution where I have a user click the RegisterLink from "@kinde-oss/kinde-auth-nextjs/components" on www.mysite.com, which will authenticate them on www.app.mysite.com. When developing locally I have the following env:
KINDE_COOKIE_DOMAIN=.localhost:3000
KINDE_SITE_URL="http://localhost:3000"
KINDE_POST_LOGOUT_REDIRECT_URL="http://app.localhost:3000"
KINDE_POST_LOGIN_REDIRECT_URL="http://app.localhost:3000/new"
Allowed Callbacks:
http://app.localhost:3000/api/auth/kinde_callback,
http://localhost:3000/api/auth/kinde_callback,
I keep getting the error - This page could not be found.
I have tried different combinations of the envs, I have also set the NextJS config to:
const nextConfig = {
env: {
KINDE_SITE_URL:
process.env.KINDE_SITE_URL ??
https://${process.env.VERCEL_URL}
,
KINDE_POST_LOGOUT_REDIRECT_URL:
process.env.KINDE_POST_LOGOUT_REDIRECT_URL ??
https://${process.env.VERCEL_URL}
,
KINDE_POST_LOGIN_REDIRECT_URL:
process.env.KINDE_POST_LOGIN_REDIRECT_URL ??
https://${process.env.VERCEL_URL}/new
,
},1 Reply
Hi @razer293 can you show the error? Is it in the browser? E.g. a 404? Do you also have a custom domain set up for app.mysite.com?