Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions ReCaptchaFrontendUi/view/frontend/web/js/reCaptcha.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ define(
* @private
*/
_loadApi: function () {
var element, scriptTag;

if (this._isApiRegistered !== undefined) {
if (this._isApiRegistered === true) {
$(window).trigger('recaptchaapiready');
Expand Down Expand Up @@ -81,7 +79,8 @@ define(
$parentForm,
$wrapper,
$reCaptcha,
widgetId;
widgetId,
parameters;

if (this.captchaInitialized) {
return;
Expand All @@ -105,7 +104,7 @@ define(
$parentForm = $wrapper.parents('form');
me = this;

let parameters = _.extend(
parameters = _.extend(
{
'callback': function (token) { // jscs:ignore jsDoc
me.reCaptchaCallback(token);
Expand Down
38 changes: 18 additions & 20 deletions ReCaptchaFrontendUi/view/frontend/web/js/reCaptchaScriptLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,28 @@
*/

define([], function () {
'use strict';
'use strict';

var scriptTagAdded = false;
var scriptTagAdded = false;

return {
/**
* Add script tag. Script tag should be added once
*/
addReCaptchaScriptTag: function () {
var element,
scriptTag;
return {
/**
* Add script tag. Script tag should be added once
*/
addReCaptchaScriptTag: function () {
var element, scriptTag;

if (!scriptTagAdded) {
element = document.createElement('script');
scriptTag = document.getElementsByTagName('script')[0];
if (!scriptTagAdded) {
element = document.createElement('script');
scriptTag = document.getElementsByTagName('script')[0];

element.async = true;
element.src = 'https://www.google.com/recaptcha/api.js' +
'?onload=globalOnRecaptchaOnLoadCallback&render=explicit';
element.async = true;
element.src = 'https://www.google.com/recaptcha/api.js' +
'?onload=globalOnRecaptchaOnLoadCallback&render=explicit';

scriptTag.parentNode.insertBefore(element, scriptTag);
scriptTagAdded = true;
}
scriptTag.parentNode.insertBefore(element, scriptTag);
scriptTagAdded = true;
}
}
}
);
};
});
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<magentoCLI command="config:set {{DisableSecurityTxt.path}} {{DisableSecurityTxt.value}}" stepKey="disableSecurityTxt"/>
</after>

<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
<actionGroup ref="FillSecurityTxtConfigurationActionGroup" stepKey="fillSecurityTxtConfiguration"/>
<actionGroup ref="AssertFullSecurityTxtConfiguration" stepKey="assertSecurityTxtContent"/>
<actionGroup ref="OpenSecurityTxtSignaturePage" stepKey="openSecurityTxtSignature"/>
Expand Down