File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 3
3
import { env } from '$env/dynamic/private' ;
4
4
import { version } from '$app/environment' ;
5
5
6
+ //write a method to handle if the KINDE_REDIRECT_URL is not a valid url new URL(env.KINDE_REDIRECT_URL).origin
7
+ function getBaseURL ( ) {
8
+ try {
9
+ return new URL ( env . KINDE_REDIRECT_URL ) . origin ;
10
+ } catch ( error ) {
11
+ return '' ;
12
+ }
13
+ }
14
+
6
15
export const kindeConfiguration = {
7
16
authDomain : env . KINDE_ISSUER_URL ,
8
17
clientId : env . KINDE_CLIENT_ID ,
9
18
logoutRedirectURL : env . KINDE_POST_LOGOUT_REDIRECT_URL ,
10
19
redirectURL : env . KINDE_REDIRECT_URL ,
11
- appBase : new URL ( env . KINDE_REDIRECT_URL ) . origin ,
20
+ appBase : getBaseURL ( ) ,
12
21
audience : env . KINDE_AUDIENCE ,
13
22
scope : env . KINDE_SCOPE ,
14
23
clientSecret : env . KINDE_CLIENT_SECRET ,
You can’t perform that action at this time.
0 commit comments