Skip to content

Commit

Permalink
PR changes
Browse files Browse the repository at this point in the history
  • Loading branch information
anku255 committed Jan 11, 2024
1 parent 1b28d6f commit 5a69ae7
Show file tree
Hide file tree
Showing 32 changed files with 452 additions and 127 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [unreleased]

## [17.0.6] - 2024-01-11

### Changes

- Added `getClockSkewInMillis` as an overrideable function in the recipe interface and dateProvider as config option, both aimed at resolving clock skew issues.

## [17.0.5] - 2024-01-03

### Fixes
Expand Down
2 changes: 1 addition & 1 deletion bundle/bundle.js

Large diffs are not rendered by default.

15 changes: 14 additions & 1 deletion lib/build/axios.js

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

10 changes: 5 additions & 5 deletions lib/build/fetch.d.ts

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

51 changes: 20 additions & 31 deletions lib/build/fetch.js

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

2 changes: 2 additions & 0 deletions lib/build/index.js

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

23 changes: 15 additions & 8 deletions lib/build/recipeImplementation.js

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

7 changes: 6 additions & 1 deletion lib/build/types.d.ts

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

6 changes: 3 additions & 3 deletions lib/build/utils/dateProvider/defaultImplementation.d.ts

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

20 changes: 12 additions & 8 deletions lib/build/utils/dateProvider/defaultImplementation.js

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

2 changes: 1 addition & 1 deletion lib/build/utils/dateProvider/index.d.ts

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

2 changes: 1 addition & 1 deletion lib/build/utils/dateProvider/index.js

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

4 changes: 2 additions & 2 deletions lib/build/utils/dateProvider/types.d.ts

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

2 changes: 1 addition & 1 deletion lib/build/version.d.ts

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

2 changes: 1 addition & 1 deletion lib/build/version.js

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

7 changes: 5 additions & 2 deletions lib/build/xmlhttprequest.js

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

15 changes: 14 additions & 1 deletion lib/ts/axios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import AuthHttpRequestFetch, {
onInvalidClaimResponse,
setToken,
fireSessionUpdateEventsIfNecessary,
getTokenForHeaderAuth
getTokenForHeaderAuth,
updateClockSkewUsingFrontToken
} from "./fetch";
import { PROCESS_STATE, ProcessState } from "./processState";
import WindowHandlerReference from "./utils/windowHandler";
Expand Down Expand Up @@ -188,6 +189,18 @@ export function responseInterceptor(axiosInstance: any) {
const preRequestLSS = await getLocalSessionState(false);
await saveTokensFromHeaders(response);

const frontToken = response.headers["front-token"];

// Converting axios headers to fetch headers to pass to updateClockSkewUsingFrontToken
const responseHeaders = new Headers();
Object.entries(response.headers).forEach(([key, value]) => {
Array.isArray(value)
? value.forEach(item => responseHeaders.append(key, item))
: responseHeaders.append(key, value);
});

updateClockSkewUsingFrontToken({ frontToken, responseHeaders });

fireSessionUpdateEventsIfNecessary(
preRequestLSS.status === "EXISTS",
response.status,
Expand Down
Loading

0 comments on commit 5a69ae7

Please sign in to comment.