Skip to content

Commit 216108c

Browse files
fixes shr interception issue (#167)
* fixes shr interception issue * small change to test
1 parent 976c02d commit 216108c

File tree

11 files changed

+23
-30
lines changed

11 files changed

+23
-30
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [unreleased]
99

10+
## [14.0.1] - 2022-10-21
11+
12+
### Fixes
13+
- Retrying request post refreshing now remembers the original input body.
14+
1015
## [14.0.0] - 2022-10-17
1116

1217
### Added

bundle/bundle.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.

lib/build/version.d.ts

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

lib/build/version.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.

lib/build/xmlhttprequest.js

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

lib/ts/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
* License for the specific language governing permissions and limitations
1313
* under the License.
1414
*/
15-
export const package_version = "14.0.0";
15+
export const package_version = "14.0.1";
1616

1717
export const supported_fdi = ["1.8", "1.9", "1.10", "1.11", "1.12", "1.13", "1.14", "1.15"];

lib/ts/xmlhttprequest.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,8 @@ export function addInterceptorsToXMLHttpRequest() {
237237
actual.open.apply(actual, args);
238238
};
239239

240-
self.send = function(body) {
240+
self.send = function(inputBody) {
241+
body = inputBody;
241242
sendXHR(actual, body);
242243
};
243244

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "supertokens-website",
3-
"version": "14.0.0",
3+
"version": "14.0.1",
44
"description": "frontend sdk for website to be used for auth solution.",
55
"main": "index.js",
66
"dependencies": {

test/axios2.test.js

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,13 +1307,7 @@ describe("Axios AuthHttpRequest class tests", function() {
13071307
}
13081308
});
13091309
console.log("TEST_EV$LOGIN_FINISH");
1310-
await axios.post(`${BASE_URL}/update-jwt`, {
1311-
headers: {
1312-
Accept: "application/json",
1313-
"Content-Type": "application/json"
1314-
},
1315-
body: JSON.stringify({ test: 1 })
1316-
});
1310+
await axios.post(`${BASE_URL}/update-jwt`, { test: 1 });
13171311
console.log("TEST_EV$UPDATE1_FINISH");
13181312
await delay(5);
13191313
await axios.get(`${BASE_URL}/`, {
@@ -1324,23 +1318,13 @@ describe("Axios AuthHttpRequest class tests", function() {
13241318
});
13251319
console.log("TEST_EV$REFRESH_FINISH");
13261320

1327-
await axios.post(`${BASE_URL}/update-jwt`, {
1328-
headers: {
1329-
Accept: "application/json",
1330-
"Content-Type": "application/json"
1331-
},
1332-
body: JSON.stringify({ test: 2 })
1333-
});
1321+
await axios.post(`${BASE_URL}/update-jwt`, { test: 2 });
1322+
assertEqual((await supertokens.getAccessTokenPayloadSecurely()).test, 2);
13341323
console.log("TEST_EV$UPDATE2_FINISH");
13351324

13361325
await delay(5);
1337-
await axios.post(`${BASE_URL}/update-jwt`, {
1338-
headers: {
1339-
Accept: "application/json",
1340-
"Content-Type": "application/json"
1341-
},
1342-
body: JSON.stringify({ test: 3 })
1343-
});
1326+
await axios.post(`${BASE_URL}/update-jwt`, { test: 3 });
1327+
assertEqual((await supertokens.getAccessTokenPayloadSecurely()).test, 3);
13441328
console.log("TEST_EV$UPDATE3_FINISH");
13451329

13461330
await axios.post(`${BASE_URL}/logout`, {

0 commit comments

Comments
 (0)