verifyRequestSignature – added an error if the passed in secret is undefined or empty

This commit is contained in:
Matt Aitken
2023-11-07 10:52:55 +00:00
parent a74716a1b9
commit 690b308fea
+7
View File
@@ -19,6 +19,13 @@ export async function verifyRequestSignature({
supported. */
algorithm: "sha256";
}): Promise<VerifyResult> {
if (!secret) {
return {
success: false,
reason: "Missing secret you've probably not set an environment variable.",
};
}
const headerValue = request.headers.get(headerName);
if (!headerValue) {
return { success: false, reason: "Missing header" };