Skip to content

Commit dab78c7

Browse files
committed
added missing access to getConfig
1 parent e9e7acf commit dab78c7

File tree

3 files changed

+27
-27
lines changed

3 files changed

+27
-27
lines changed

dist/breinify-unsubscribe.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@
2929
}
3030
},
3131

32-
getValidationToken: function () {
32+
getValidationToken: function (plugin) {
3333
if (this.tokenCodeValidation === null) {
34-
this.tokenCodeValidation = this._determineValidationToken();
34+
this.tokenCodeValidation = this._determineValidationToken(plugin);
3535
}
3636

3737
return this.tokenCodeValidation;
3838
},
3939

40-
getUnsubscribeToken: function () {
40+
getUnsubscribeToken: function (plugin) {
4141
if (this.tokenCodeUnsubscribe === null) {
42-
this.tokenCodeUnsubscribe = this._determineUnsubscribeToken();
42+
this.tokenCodeUnsubscribe = this._determineUnsubscribeToken(plugin);
4343
}
4444

4545
return this.tokenCodeUnsubscribe;
@@ -58,22 +58,22 @@
5858
}
5959
},
6060

61-
_determineValidationToken: function () {
62-
return this._determineToken('tokenCodeValidation', 'testTokenCodeValidation');
61+
_determineValidationToken: function (plugin) {
62+
return this._determineToken('tokenCodeValidation', 'testTokenCodeValidation', plugin);
6363
},
6464

65-
_determineUnsubscribeToken: function () {
66-
return this._determineToken('tokenCodeUnsubscribe', 'testTokenCodeUnsubscribe');
65+
_determineUnsubscribeToken: function (plugin) {
66+
return this._determineToken('tokenCodeUnsubscribe', 'testTokenCodeUnsubscribe', plugin);
6767
},
6868

69-
_determineToken: function (cfgName, cfgTestName) {
69+
_determineToken: function (cfgName, cfgTestName, plugin) {
7070
var token = null;
7171
if (Breinify.plugins._isAdded('api') && Breinify.plugins.api.determineMode() !== 'prod') {
72-
token = this.getConfig(cfgTestName, null);
72+
token = plugin.getConfig(cfgTestName, null);
7373
}
7474

7575
if (token === null) {
76-
token = this.getConfig(cfgName, null);
76+
token = plugin.getConfig(cfgName, null);
7777
}
7878

7979
return token;
@@ -87,7 +87,7 @@
8787
},
8888

8989
validate: function (callback, code) {
90-
var token = _private.getValidationToken();
90+
var token = _private.getValidationToken(this);
9191
code = _private.getCode(code);
9292

9393
if (!_private.check(token, code, callback)) {
@@ -118,7 +118,7 @@
118118
},
119119

120120
unsubscribe: function (status, callback, code) {
121-
var token = _private.getUnsubscribeToken();
121+
var token = _private.getUnsubscribeToken(this);
122122
code = _private.getCode(code);
123123

124124
if (!_private.check(token, code, callback)) {

dist/breinify-unsubscribe.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/plugins/Unsubscribe.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@
2929
}
3030
},
3131

32-
getValidationToken: function () {
32+
getValidationToken: function (plugin) {
3333
if (this.tokenCodeValidation === null) {
34-
this.tokenCodeValidation = this._determineValidationToken();
34+
this.tokenCodeValidation = this._determineValidationToken(plugin);
3535
}
3636

3737
return this.tokenCodeValidation;
3838
},
3939

40-
getUnsubscribeToken: function () {
40+
getUnsubscribeToken: function (plugin) {
4141
if (this.tokenCodeUnsubscribe === null) {
42-
this.tokenCodeUnsubscribe = this._determineUnsubscribeToken();
42+
this.tokenCodeUnsubscribe = this._determineUnsubscribeToken(plugin);
4343
}
4444

4545
return this.tokenCodeUnsubscribe;
@@ -58,22 +58,22 @@
5858
}
5959
},
6060

61-
_determineValidationToken: function () {
62-
return this._determineToken('tokenCodeValidation', 'testTokenCodeValidation');
61+
_determineValidationToken: function (plugin) {
62+
return this._determineToken('tokenCodeValidation', 'testTokenCodeValidation', plugin);
6363
},
6464

65-
_determineUnsubscribeToken: function () {
66-
return this._determineToken('tokenCodeUnsubscribe', 'testTokenCodeUnsubscribe');
65+
_determineUnsubscribeToken: function (plugin) {
66+
return this._determineToken('tokenCodeUnsubscribe', 'testTokenCodeUnsubscribe', plugin);
6767
},
6868

69-
_determineToken: function (cfgName, cfgTestName) {
69+
_determineToken: function (cfgName, cfgTestName, plugin) {
7070
var token = null;
7171
if (Breinify.plugins._isAdded('api') && Breinify.plugins.api.determineMode() !== 'prod') {
72-
token = this.getConfig(cfgTestName, null);
72+
token = plugin.getConfig(cfgTestName, null);
7373
}
7474

7575
if (token === null) {
76-
token = this.getConfig(cfgName, null);
76+
token = plugin.getConfig(cfgName, null);
7777
}
7878

7979
return token;
@@ -87,7 +87,7 @@
8787
},
8888

8989
validate: function (callback, code) {
90-
var token = _private.getValidationToken();
90+
var token = _private.getValidationToken(this);
9191
code = _private.getCode(code);
9292

9393
if (!_private.check(token, code, callback)) {
@@ -118,7 +118,7 @@
118118
},
119119

120120
unsubscribe: function (status, callback, code) {
121-
var token = _private.getUnsubscribeToken();
121+
var token = _private.getUnsubscribeToken(this);
122122
code = _private.getCode(code);
123123

124124
if (!_private.check(token, code, callback)) {

0 commit comments

Comments
 (0)