Skip to content

Commit

Permalink
fix: PR changes
Browse files Browse the repository at this point in the history
  • Loading branch information
anku255 committed Jun 5, 2024
1 parent 6756e33 commit 866a0f9
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bundle/bundle.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions lib/build/axios.js

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

6 changes: 4 additions & 2 deletions lib/build/xmlhttprequest.js

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

4 changes: 4 additions & 0 deletions lib/ts/axios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,10 @@ export default class AuthHttpRequest {
let response =
localPrevResponse === undefined ? await httpCall(configWithAntiCsrf) : localPrevResponse;

// NOTE: No need to check for unauthorized response status here for session refresh,
// as we only reach this point on a successful response. Axios handles error responses
// by throwing an error, which is handled in the catch block.

logDebugMessage("doRequest: User's http call ended");

await saveTokensFromHeaders(response);
Expand Down
6 changes: 4 additions & 2 deletions lib/ts/xmlhttprequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,11 @@ export function addInterceptorsToXMLHttpRequest() {
// Here we only need to handle fetch related errors, from the refresh endpoint called by the retry
// So we should only get network level errors here

const ev = new Event("error");
const ev = new ProgressEvent("error");
(ev as any).error = err;
self.dispatchEvent(ev);
if (self.onerror !== undefined && self.onerror !== null) {
self.onerror(ev);
}

redispatchEvent("error", ev);
}
Expand Down

0 comments on commit 866a0f9

Please sign in to comment.