File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ Next step, create `.env` file:
75
75
KINDE_AUDIENCE=your_kinde_api
76
76
KINDE_CLIENT_ID=your_kinde_client_id // Please use an application with password method
77
77
KINDE_CLIENT_SECRET=your_kinde_client_secret
78
+ KINDE_COOKIE_DOMAIN=// domain to assign cookie to
78
79
KINDE_ISSUER_URL=https://your_kinde_domain.kinde.com
79
80
KINDE_POST_LOGIN_REDIRECT_URL=http://localhost:4173
80
81
KINDE_POST_LOGOUT_REDIRECT_URL=http://localhost:4173
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ export async function sessionHooks({ event }: { event: EventHandler }) {
11
11
? itemValue
12
12
: ( JSON . stringify ( itemValue ) as string ) ,
13
13
{
14
+ domain : process . env . KINDE_COOKIE_DOMAIN ,
14
15
path : "/" ,
15
16
secure : process . env . NODE_ENV === "production" ,
16
17
sameSite : "lax" ,
@@ -40,13 +41,17 @@ export async function sessionHooks({ event }: { event: EventHandler }) {
40
41
event . request . removeSessionItem = async ( itemKey : string ) => {
41
42
return event . cookies . delete ( `kinde_${ itemKey } ` , {
42
43
path : "/" ,
44
+ domain : process . env . KINDE_COOKIE_DOMAIN ,
43
45
} ) ;
44
46
} ;
45
47
46
48
event . request . destroySession = async ( ) => {
47
49
event . cookies . getAll ( ) . forEach ( ( item ) => {
48
50
if ( / ^ k i n d e _ / . test ( item . name ) ) {
49
- event . cookies . delete ( item . name , { path : "/" } ) ;
51
+ event . cookies . delete ( item . name , {
52
+ path : "/" ,
53
+ domain : process . env . KINDE_COOKIE_DOMAIN ,
54
+ } ) ;
50
55
}
51
56
} ) ;
52
57
return ;
You can’t perform that action at this time.
0 commit comments