23 lines
548 B
JavaScript
23 lines
548 B
JavaScript
// @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",
|
|
}
|
|
}
|
|
}
|
|
|
|
/** @type {import('wmbasic-api-types').HookResponse} */
|
|
// @ts-ignore
|
|
var response = null
|
|
return response
|
|
})()
|