File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44# FRONTEND_URL=https://YOUR_FRONTEND_URL
55# CONVEX_URL=https://YOUR_CONVEX_URL
66
7-
87# KINDE_DOMAIN=https://<YOUR_SUBDOMAIN>.kinde.com
98# KINDE_CLIENT_ID=<YOUR_CLIENT_ID>
109# KINDE_CLIENT_SECRET=<YOUR_CLIENT_SECRET>
Original file line number Diff line number Diff line change @@ -8,5 +8,5 @@ CONVEX_URL=
88# KINDE_DOMAIN=https://<YOUR_SUBDOMAIN>.kinde.com
99# KINDE_CLIENT_ID=<YOUR_CLIENT_ID>
1010# KINDE_CLIENT_SECRET=<YOUR_CLIENT_SECRET>
11- # KINDE_REDIRECT_URI=http ://localhost:3000 /callback
12- # KINDE_LOGOUT_REDIRECT_URI=https://<YOUR_SUBDOMAIN>.kinde.com/logged -out
11+ KINDE_REDIRECT_URI = https ://127.0.0.1:3300/api/auth /callback
12+ KINDE_LOGOUT_REDIRECT_URI = https://127.0.0.1:3300/signed -out
Original file line number Diff line number Diff line change @@ -21,12 +21,20 @@ export async function initKindeClient() {
2121 if ( ! isNonSharingPlatforms && cachedClient )
2222 console . warn ( 'Already initialized' )
2323
24- const client = createKindeServerClient ( GrantType . AUTHORIZATION_CODE , {
24+ const requiredEnvs = {
2525 authDomain : env . KINDE_DOMAIN ! ,
2626 clientId : env . KINDE_CLIENT_ID ! ,
2727 clientSecret : env . KINDE_CLIENT_SECRET ! ,
2828 redirectURL : env . KINDE_REDIRECT_URI ! ,
2929 logoutRedirectURL : env . KINDE_LOGOUT_REDIRECT_URI ! ,
30+ }
31+
32+ const missingEnvs = Object . entries ( requiredEnvs ) . flatMap ( ( [ key , value ] ) => value ? [ ] : key )
33+ if ( missingEnvs . length )
34+ throw new Error ( `Missing required env: ${ missingEnvs . join ( ', ' ) } ` )
35+
36+ const client = createKindeServerClient ( GrantType . AUTHORIZATION_CODE , {
37+ ...requiredEnvs ,
3038 } )
3139
3240 cacheProvider ( 'kinde-main--client' , client )
You can’t perform that action at this time.
0 commit comments