Skip to content

Commit

Permalink
PR changes
Browse files Browse the repository at this point in the history
  • Loading branch information
anku255 committed Jan 23, 2024
1 parent ccbaf03 commit 739ec29
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion bundle/bundle.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions lib/build/claims/primitiveArrayClaim.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/claims/primitiveClaim.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/defaultImplementation.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/ts/claims/primitiveArrayClaim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class PrimitiveArrayClaim<ValueType> {
shouldRefresh: (payload, ctx) => {
if (maxAgeInSeconds !== undefined && maxAgeInSeconds < DateProvider.getThresholdInSeconds()) {
throw new Error(
`maxAgeInSeconds must be greater than the DateProvider threshold value -> ${DateProvider.getThresholdInSeconds()}`
`maxAgeInSeconds must be greater than or equal to the DateProvider threshold value -> ${DateProvider.getThresholdInSeconds()}`
);
}

Expand Down Expand Up @@ -91,7 +91,7 @@ export class PrimitiveArrayClaim<ValueType> {
shouldRefresh: (payload, ctx) => {
if (maxAgeInSeconds !== undefined && maxAgeInSeconds < DateProvider.getThresholdInSeconds()) {
throw new Error(
`maxAgeInSeconds must be greater than the DateProvider threshold value -> ${DateProvider.getThresholdInSeconds()}`
`maxAgeInSeconds must be greater than or equal to the DateProvider threshold value -> ${DateProvider.getThresholdInSeconds()}`
);
}
return (
Expand Down Expand Up @@ -146,7 +146,7 @@ export class PrimitiveArrayClaim<ValueType> {
shouldRefresh: (payload, ctx) => {
if (maxAgeInSeconds !== undefined && maxAgeInSeconds < DateProvider.getThresholdInSeconds()) {
throw new Error(
`maxAgeInSeconds must be greater than the DateProvider threshold value -> ${DateProvider.getThresholdInSeconds()}`
`maxAgeInSeconds must be greater than or equal to the DateProvider threshold value -> ${DateProvider.getThresholdInSeconds()}`
);
}
return (
Expand Down Expand Up @@ -198,7 +198,7 @@ export class PrimitiveArrayClaim<ValueType> {
shouldRefresh: (payload, ctx) => {
if (maxAgeInSeconds !== undefined && maxAgeInSeconds < DateProvider.getThresholdInSeconds()) {
throw new Error(
`maxAgeInSeconds must be greater than the DateProvider threshold value -> ${DateProvider.getThresholdInSeconds()}`
`maxAgeInSeconds must be greater than or equal to the DateProvider threshold value -> ${DateProvider.getThresholdInSeconds()}`
);
}

Expand Down Expand Up @@ -255,7 +255,7 @@ export class PrimitiveArrayClaim<ValueType> {
shouldRefresh: (payload, ctx) => {
if (maxAgeInSeconds !== undefined && maxAgeInSeconds < DateProvider.getThresholdInSeconds()) {
throw new Error(
`maxAgeInSeconds must be greater than the DateProvider threshold value -> ${DateProvider.getThresholdInSeconds()}`
`maxAgeInSeconds must be greater than or equal to the DateProvider threshold value -> ${DateProvider.getThresholdInSeconds()}`
);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/ts/claims/primitiveClaim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class PrimitiveClaim<ValueType> {
shouldRefresh: (payload, ctx) => {
if (maxAgeInSeconds !== undefined && maxAgeInSeconds < DateProvider.getThresholdInSeconds()) {
throw new Error(
`maxAgeInSeconds must be greater than the DateProvider threshold value -> ${DateProvider.getThresholdInSeconds()}`
`maxAgeInSeconds must be greater than or equal to the DateProvider threshold value -> ${DateProvider.getThresholdInSeconds()}`
);
}
return (
Expand Down
2 changes: 1 addition & 1 deletion lib/ts/utils/dateProvider/defaultImplementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class DateProvider {
}

setClientClockSkewInMillis(clockSkewInMillis: number): void {
this.clockSkewInMillis = Math.abs(clockSkewInMillis) > this.thresholdInSeconds * 1000 ? clockSkewInMillis : 0;
this.clockSkewInMillis = Math.abs(clockSkewInMillis) >= this.thresholdInSeconds * 1000 ? clockSkewInMillis : 0;
const localStorage = WindowHandlerReference.getReferenceOrThrow().windowHandler.localStorage;
localStorage.setItemSync(DateProvider.CLOCK_SKEW_KEY, String(clockSkewInMillis));
}
Expand Down
2 changes: 1 addition & 1 deletion test/sessionClaimValidatorRefresh.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function withFakeClock(now, cb) {
describe("SessionClaimValidator Refresh", () => {
jsdom({ url: "http://localhost" });

describe("SessionClaimValidator Instantiation ", () => {
describe("SessionClaimValidator:shouldRefresh", () => {
before(function () {
WindowHandlerReference.init();
DateProviderReference.init();
Expand Down

0 comments on commit 739ec29

Please sign in to comment.