package ez_api
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Easy API library and tools
Install
dune-project
Dependency
Authors
Maintainers
Sources
3.0.0.tar.gz
md5=9069f59ac83c958cedc90a25f24faa1e
sha512=4b066a759043e6704a9617bdc412d29f7ded058cb0e01eb3a8207f54b80bebb478bb98a96832e61b15d281bc8f132e1386459c563eb807a51c01324541fe28b2
doc/src/ez_api.recaptcha/ezRecaptcha.ml.html
Source file ezRecaptcha.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49(**************************************************************************) (* *) (* Copyright 2018-2023 OCamlPro *) (* *) (* All rights reserved. This file is distributed under the terms of the *) (* GNU Lesser General Public License version 2.1, with the special *) (* exception on linking described in the file LICENSE. *) (* *) (**************************************************************************) type recaptcha = { cap_success: bool; cap_score: float option; cap_action: string option; cap_challenge_ts: string option; cap_hostname: string option; cap_error_codes: string list option } module Encoding = struct open Json_encoding let captcha = conv (fun {cap_success; cap_score; cap_action; cap_challenge_ts; cap_hostname; cap_error_codes} -> (cap_success, cap_score, cap_action, cap_challenge_ts, cap_hostname, cap_error_codes)) (fun (cap_success, cap_score, cap_action, cap_challenge_ts, cap_hostname, cap_error_codes) -> {cap_success; cap_score; cap_action; cap_challenge_ts; cap_hostname; cap_error_codes}) (obj6 (req "success" bool) (opt "score" float) (opt "action" string) (opt "challenge_ts" string) (opt "hostname" string) (opt "error-codes" (list string))) end let recaptcha_url = "https://www.google.com/recaptcha/api/siteverify" let verify secret_key token = let url = EzAPI.URL ( recaptcha_url ^ "?secret=" ^ secret_key ^ "&response=" ^ token) in Lwt.map (function Error e -> Error e | Ok x -> Ok (EzEncoding.destruct Encoding.captcha x)) (EzReq_lwt.post url)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>