diff --git a/src/utils/auth.ts b/src/utils/auth.ts index c3bfb2a9a..e3ccc3b4b 100644 --- a/src/utils/auth.ts +++ b/src/utils/auth.ts @@ -53,18 +53,20 @@ export async function validateAdminSignature( if (allowed) { return { valid: true, error: '' } } - for (const chainId of Object.keys(accessLists)) { - allowed = await checkSingleCredential( - { - type: CREDENTIALS_TYPES.ACCESS_LIST, - chainId: parseInt(chainId), - accessList: accessLists[chainId] - }, - signerAddress, - null - ) - if (allowed) { - return { valid: true, error: '' } + if (accessLists) { + for (const chainId of Object.keys(accessLists)) { + allowed = await checkSingleCredential( + { + type: CREDENTIALS_TYPES.ACCESS_LIST, + chainId: parseInt(chainId), + accessList: accessLists[chainId] + }, + signerAddress, + null + ) + if (allowed) { + return { valid: true, error: '' } + } } } diff --git a/src/utils/credentials.ts b/src/utils/credentials.ts index 0cff6e76d..d54692b4f 100644 --- a/src/utils/credentials.ts +++ b/src/utils/credentials.ts @@ -186,7 +186,7 @@ export async function checkSingleCredential( // Check if address is in the list const normalizedValues = addressCredential.values.map((v: string) => v.toLowerCase()) - return normalizedValues.includes(consumerAddress) + return normalizedValues.includes(consumerAddress.toLowerCase()) } // ========================================