$recaptcha.getResponse() rejected with `undefined` when used wrong key
zoxon opened this issue · 2 comments
zoxon commented
async onSubmit() {
try {
const token = await this.$recaptcha.getResponse();
this.recaptcha = token;
console.log(this.$data);
} catch (error) {
console.log(error); // undefined
}
}
Configuration
{
siteKey: "6LeXSaMZAAAAAKSyzQHnpkZKIN7bbnXq3nm1O6Go",
size: "invisible",
hideBadge: true,
version: 2
}
Reproduction url
https://codesandbox.io/s/falling-water-p3zl4?file=/pages/index.vue:998-1039
ems1985 commented
farnabaz commented
The Uncaught
exception and null
error is related to recaptcha and the reason is you are using invalid site key.
There is some situation that this error raises, Check this question on stack: https://stackoverflow.com/questions/52390562/google-recaptcha-response-uncaught-in-promise-null