tibi-svelte-starter/api/hooks/contact_form/post_create.js

23 lines
548 B
JavaScript
Raw Normal View History

2021-03-22 15:59:05 +01:00
// @ts-check
var utils = require("../lib/utils")
;(function () {
if (utils.isPublicToken(context)) {
// js captcha
var checksum = context.request().query("cs")
var email = context.data.email
if (!email || (email.length * 1000).toString(16) + "x" !== checksum) {
throw {
status: 403,
error: "forbidden data",
}
}
}
2021-08-16 11:07:11 +02:00
/** @type {import('wmbasic-api-types').HookResponse} */
2021-03-22 15:59:05 +01:00
// @ts-ignore
var response = null
return response
})()