Skip to content

Commit ad65192

Browse files
author
Oleksandr Osadchyi
committed
MAGETWO-59135: [Github] Customer session is shared for different customers on two websites #4842 #6468
1 parent 232fa6b commit ad65192

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

app/code/Magento/Customer/view/frontend/web/js/invalidation-processor.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ define([
1010
'use strict';
1111

1212
return Element.extend({
13+
/**
14+
* Initialize object
15+
*/
1316
initialize: function () {
1417
this._super();
1518
this.process(customerData);
@@ -24,12 +27,12 @@ define([
2427
_.each(this.invalidationRules, function (rule, ruleName) {
2528
_.each(rule, function (ruleArgs, rulePath) {
2629
require([rulePath], function (Rule) {
27-
var rule = new Rule(ruleArgs);
30+
var currentRule = new Rule(ruleArgs);
2831

29-
if (!_.isFunction(rule.process)) {
32+
if (!_.isFunction(currentRule.process)) {
3033
throw new Error('Rule ' + ruleName + ' should implement invalidationProcessor interface');
3134
}
32-
rule.process(customerDataObject);
35+
currentRule.process(customerDataObject);
3336
});
3437
});
3538
});

app/code/Magento/Customer/view/frontend/web/js/invalidation-rules/website-rule.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* See COPYING.txt for license details.
44
*/
55
define([
6-
"uiClass"
6+
'uiClass'
77
], function (Element) {
88
'use strict';
99

@@ -12,6 +12,7 @@ define([
1212
defaults: {
1313
scopeConfig: {}
1414
},
15+
1516
/**
1617
* Takes website id from current customer data and compare it with current website id
1718
* If customer belongs to another scope, we need to invalidate current section

dev/tests/js/jasmine/tests/app/code/Magento/Customer/frontend/js/invalidation-processor.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ define([
3232

3333
describe('"process" method', function () {
3434
it('record status is 1', function () {
35+
/*eslint no-global-assign: "error"*/
36+
3537
var requireTmp = require;
36-
/* eslint-disable no-global-assign */
38+
3739
require = jasmine.createSpy();
3840
processor.process();
3941

0 commit comments

Comments
 (0)