Commit 1ae0f90 1 parent e3dc5a2 commit 1ae0f90 Copy full SHA for 1ae0f90
File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import type { H3Event } from 'h3'
2
2
import { getHeader , createError , handleCors } from 'h3'
3
3
import { $fetch } from 'ofetch'
4
4
5
- const localCache : Record < string , boolean > = { }
5
+ const localCache : Map < string , boolean > = new Map ( )
6
6
7
7
export async function requireNuxtHubAuthorization ( event : H3Event ) {
8
8
// Skip if in development
@@ -39,7 +39,7 @@ export async function requireNuxtHubAuthorization(event: H3Event) {
39
39
40
40
// Hosted on NuxtHub
41
41
if ( projectKey ) {
42
- if ( localCache [ secretKeyOrUserToken ] ) {
42
+ if ( localCache . has ( secretKeyOrUserToken ) ) {
43
43
return
44
44
}
45
45
// Here the secretKey is a user token
@@ -50,7 +50,7 @@ export async function requireNuxtHubAuthorization(event: H3Event) {
50
50
authorization : `Bearer ${ secretKeyOrUserToken } `
51
51
}
52
52
} )
53
- localCache [ secretKeyOrUserToken ] = true
53
+ localCache . set ( secretKeyOrUserToken , true )
54
54
return
55
55
}
56
56
You can’t perform that action at this time.
0 commit comments