Skip to content

Commit

Permalink
feat: simplify
Browse files Browse the repository at this point in the history
Signed-off-by: Pablo Maldonado <[email protected]>
  • Loading branch information
md0x committed Dec 11, 2024
1 parent 9ef9df6 commit ad9145e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions api/relayer-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@ const handlePostRequest = async (
return response.status(400).json({ message: "Message too old" });
}

if (!authorization) {
return response.status(401).json({ message: "Unauthorized" });
}

const relayer = getRelayerFromSignature(authorization, JSON.stringify(body));

if (!getWhiteListedRelayers().includes(relayer)) {
if (
!authorization ||
!getWhiteListedRelayers().includes(
getRelayerFromSignature(authorization, JSON.stringify(body))
)
) {
return response.status(401).json({ message: "Unauthorized" });
}

Expand Down

0 comments on commit ad9145e

Please sign in to comment.