Skip to content

Commit 4f99220

Browse files
committed
removed stray log + added minor validation w/ @Code-Hex
Also removed redundant "import type {} from '../..'" from 3 different files: - jwk/index.ts - jwt/index.ts - request-id/index.ts
1 parent e26aece commit 4f99220

File tree

4 files changed

+3
-4
lines changed

4 files changed

+3
-4
lines changed

src/middleware/jwk/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
export { jwk } from './jwk'
2-
import type {} from '../..'

src/middleware/jwk/jwk.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ export const jwk = (
8383
options.cookie.key,
8484
options.cookie.prefixOptions
8585
)
86-
console.log('TOK', token, options, ctx.req.raw.headers)
8786
} else {
8887
token = await getSignedCookie(ctx, options.cookie.secret, options.cookie.key)
8988
}
@@ -119,6 +118,9 @@ export const jwk = (
119118
if (!data.keys) {
120119
throw new Error('invalid JWKS response. "keys" field is missing')
121120
}
121+
if (!Array.isArray(data.keys)) {
122+
throw new Error('invalid JWKS response. "keys" field is not an array')
123+
}
122124
if (keys) {
123125
keys.push(...data.keys)
124126
} else {

src/middleware/jwt/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import type { JwtVariables } from './jwt'
22
export type { JwtVariables }
33
export { jwt, verify, decode, sign } from './jwt'
4-
import type {} from '../..'
54

65
declare module '../..' {
76
interface ContextVariableMap extends JwtVariables {}

src/middleware/request-id/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import type { RequestIdVariables } from './request-id'
22
export type { RequestIdVariables }
33
export { requestId } from './request-id'
4-
import type {} from '../..'
54

65
declare module '../..' {
76
interface ContextVariableMap extends RequestIdVariables {}

0 commit comments

Comments
 (0)