File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,15 +71,16 @@ export async function authenticateApiKeyFromHeader(
7171 }
7272
7373 try {
74- const [ workspaceSettings , hashCandidate ] = await Promise . all ( [
75- options . workspaceId ? getWorkspaceBillingSettings ( options . workspaceId ) : null ,
76- lookupByHash ( apiKeyHeader ) ,
77- ] )
74+ let workspaceSettings : WorkspaceBillingSettings | null = null
7875
79- if ( options . workspaceId && ! workspaceSettings ) {
80- return { success : false , error : 'Workspace not found' }
76+ if ( options . workspaceId ) {
77+ workspaceSettings = await getWorkspaceBillingSettings ( options . workspaceId )
78+ if ( ! workspaceSettings ) {
79+ return { success : false , error : 'Workspace not found' }
80+ }
8181 }
8282
83+ const hashCandidate = await lookupByHash ( apiKeyHeader )
8384 if ( hashCandidate !== null ) {
8485 return await applyHashGates ( hashCandidate , options , workspaceSettings )
8586 }
You can’t perform that action at this time.
0 commit comments