File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 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'
22import { getHeader , createError , handleCors } from 'h3'
33import { $fetch } from 'ofetch'
44
5- const localCache : Record < string , boolean > = { }
5+ const localCache : Map < string , boolean > = new Map ( )
66
77export async function requireNuxtHubAuthorization ( event : H3Event ) {
88 // Skip if in development
@@ -39,7 +39,7 @@ export async function requireNuxtHubAuthorization(event: H3Event) {
3939
4040 // Hosted on NuxtHub
4141 if ( projectKey ) {
42- if ( localCache [ secretKeyOrUserToken ] ) {
42+ if ( localCache . has ( secretKeyOrUserToken ) ) {
4343 return
4444 }
4545 // Here the secretKey is a user token
@@ -50,7 +50,7 @@ export async function requireNuxtHubAuthorization(event: H3Event) {
5050 authorization : `Bearer ${ secretKeyOrUserToken } `
5151 }
5252 } )
53- localCache [ secretKeyOrUserToken ] = true
53+ localCache . set ( secretKeyOrUserToken , true )
5454 return
5555 }
5656
You can’t perform that action at this time.
0 commit comments