Skip to content

Commit

Permalink
[feature] allow receiving & sending cookies by a CORS request
Browse files Browse the repository at this point in the history
  • Loading branch information
zbigh committed Sep 6, 2020
1 parent 0f5a55a commit a855e95
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
6 changes: 6 additions & 0 deletions __tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,10 @@ describe("init", () => {
init({ protocolWithHost: "https://localhost:3000/" });
expect(Config.protocolWithHost).toEqual("https://localhost:3000");
});

it("sets cookiesByCORS on LocoJSModel", () => {
expect(Config.cookiesByCORS).toEqual(false);
init({ cookiesByCORS: true });
expect(Config.cookiesByCORS).toEqual(true);
});
});
2 changes: 1 addition & 1 deletion dist/loco.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"dependencies": {
"loco-js-core": "^0.2.1",
"loco-js-model": "^1.0.0"
"loco-js-model": "^1.1.0"
},
"devDependencies": {
"@babel/core": "^7.11.1",
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const emit = args => Env.loco.emit(args);
const init = opts => {
Config.locale = opts.locale || "en";
Config.protocolWithHost = opts.protocolWithHost;
Config.cookiesByCORS = opts.cookiesByCORS || false;
External.cable = opts.cable;
External.NotificationCenter = opts.notificationCenter;
new Loco(opts).init({
Expand Down

0 comments on commit a855e95

Please sign in to comment.