Skip to content

Commit

Permalink
fix: ensure we always release the claim refresh lock
Browse files Browse the repository at this point in the history
  • Loading branch information
porcellus committed May 23, 2024
1 parent 87d9140 commit 181853a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bundle/bundle.js

Large diffs are not rendered by default.

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

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

8 changes: 5 additions & 3 deletions lib/ts/recipeImplementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,12 @@ export default function RecipeImplementation(recipeImplInput: {
logDebugMessage("validateClaims: trying to acquire claim refresh lock");
const claimRefreshLock = await lockFactory.acquireLock(CLAIM_REFRESH_LOCK_NAME);
if (claimRefreshLock) {
accessTokenPayload = await this.getAccessTokenPayloadSecurely({ userContext: input.userContext });
logDebugMessage("validateClaims: claim refresh lock acquired");
// to sync across tabs. the 1000 ms wait is for how much time to try and acquire the lock
try {
accessTokenPayload = await this.getAccessTokenPayloadSecurely({
userContext: input.userContext
});
logDebugMessage("validateClaims: claim refresh lock acquired");
// to sync across tabs. the 1000 ms wait is for how much time to try and acquire the lock
for (const validator of input.claimValidators) {
if (await validator.shouldRefresh(accessTokenPayload, input.userContext)) {
try {
Expand Down

0 comments on commit 181853a

Please sign in to comment.