Skip to content

Instantly share code, notes, and snippets.


Ctibor Laky luckylooke

View GitHub Profile
luckylooke / recaptcha_fallback.js
Created Aug 21, 2019
Google recaptcha wrapper for grecaptcha.execute() with version 2 fallback.
View recaptcha_fallback.js
function execute(action, callback) {
// create real promise, because execute method does not return the real one
// (missing documentation what actually returns)
const promise = new Promise((resolve, reject) => {
grecaptcha.ready(() =>
grecaptcha.execute(key, { action }).then(token => {
You can’t perform that action at this time.