File tree 4 files changed +5
-7
lines changed
4 files changed +5
-7
lines changed Original file line number Diff line number Diff line change 1
- import {
2
- authMiddleware ,
3
- withAuth ,
4
- } from "@kinde-oss/kinde-auth-nextjs/middleware" ;
1
+ import { withAuth } from '@kinde-oss/kinde-auth-nextjs/middleware' ;
5
2
6
3
export default function middleware ( req : Request ) {
7
4
return withAuth ( req ) ;
8
5
}
9
6
10
7
export const config = {
11
- matcher : [ " /dashboard" ] ,
8
+ matcher : [ ' /dashboard' ]
12
9
} ;
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ export const config = {
69
69
clientID : KINDE_CLIENT_ID ,
70
70
clientSecret : KINDE_CLIENT_SECRET ,
71
71
postLogoutRedirectURL : KINDE_POST_LOGOUT_REDIRECT_URL ,
72
- audience : KINDE_AUDIENCE ,
72
+ audience : KINDE_AUDIENCE ? KINDE_AUDIENCE . split ( ' ' ) : '' ,
73
73
cookieDomain : KINDE_COOKIE_DOMAIN ,
74
74
responseType : 'code' ,
75
75
codeChallengeMethod : 'S256' ,
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ const isTokenValid = (token) => {
11
11
if ( config . audience )
12
12
isAudienceValid =
13
13
accessTokenPayload . aud &&
14
- accessTokenPayload . aud . includes ( config . audience ) ;
14
+ accessTokenPayload . aud . includes ( ... config . audience ) ;
15
15
16
16
if (
17
17
accessTokenPayload . iss == config . issuerURL &&
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import {
12
12
export type KindeAccessToken = {
13
13
aud : string [ ] ;
14
14
azp : number ;
15
+ exp : number ;
15
16
iat : number ;
16
17
iss : string ;
17
18
jti : string ;
You can’t perform that action at this time.
0 commit comments