Skip to content

Commit 95d8e41

Browse files
authored
fix: update signature validation (#1153)
1 parent 9cd4598 commit 95d8e41

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

src/utils/auth.ts

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,20 @@ export async function validateAdminSignature(
5353
if (allowed) {
5454
return { valid: true, error: '' }
5555
}
56-
for (const chainId of Object.keys(accessLists)) {
57-
allowed = await checkSingleCredential(
58-
{
59-
type: CREDENTIALS_TYPES.ACCESS_LIST,
60-
chainId: parseInt(chainId),
61-
accessList: accessLists[chainId]
62-
},
63-
signerAddress,
64-
null
65-
)
66-
if (allowed) {
67-
return { valid: true, error: '' }
56+
if (accessLists) {
57+
for (const chainId of Object.keys(accessLists)) {
58+
allowed = await checkSingleCredential(
59+
{
60+
type: CREDENTIALS_TYPES.ACCESS_LIST,
61+
chainId: parseInt(chainId),
62+
accessList: accessLists[chainId]
63+
},
64+
signerAddress,
65+
null
66+
)
67+
if (allowed) {
68+
return { valid: true, error: '' }
69+
}
6870
}
6971
}
7072

src/utils/credentials.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export async function checkSingleCredential(
186186

187187
// Check if address is in the list
188188
const normalizedValues = addressCredential.values.map((v: string) => v.toLowerCase())
189-
return normalizedValues.includes(consumerAddress)
189+
return normalizedValues.includes(consumerAddress.toLowerCase())
190190
}
191191

192192
// ========================================

0 commit comments

Comments
 (0)