Skip to content

Commit 155c9ee

Browse files
authored
Added type option to Google reCaptcha
Type of reCaptcha to render, image or audio. (defaults to image) HTML attribute: `data-validation-recaptcha-type="image|audio"` JS config setting: `reCaptchaSize: 'image|audio'`
1 parent b18d856 commit 155c9ee

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/modules/security.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,8 @@
562562
div = document.createElement('DIV'),
563563
siteKey = config.reCaptchaSiteKey || $input.valAttr('recaptcha-sitekey'),
564564
theme = config.reCaptchaTheme || $input.valAttr('recaptcha-theme') || 'light',
565-
size = config.reCaptchaSize || $input.valAttr('recaptcha-size') || 'normal';
565+
size = config.reCaptchaSize || $input.valAttr('recaptcha-size') || 'normal',
566+
type = config.reCaptchaType || $input.valAttr('recaptcha-type') || 'image';
566567

567568
if (!siteKey) {
568569
throw new Error('Google reCaptcha site key is required.');
@@ -579,7 +580,8 @@
579580
var widgetId = grecaptcha.render(div, {
580581
sitekey: siteKey,
581582
theme: theme,
582-
size: size,
583+
size: size,
584+
type: type,
583585
callback: grecaptchaRenderCallback,
584586
'expired-callback': grecaptchaRenderCallback
585587
});

0 commit comments

Comments
 (0)