Skip to content

Commit

Permalink
fix(oidc): renew with simple storage (#1246) (release)
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaume-chervet committed Dec 19, 2023
1 parent 7a9dab1 commit 819962b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/oidc-client/src/renewTokens.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {initSession} from './initSession.js';
import {initWorkerAsync} from './initWorker.js';
import Oidc from './oidc.js';
import {computeTimeLeft} from './parseTokens.js';
import {computeTimeLeft, setTokens} from './parseTokens.js';
import timer from './timer.js';
import {StringMap} from './types.js';

Expand Down Expand Up @@ -32,7 +32,9 @@ async function loadLatestTokensAsync(oidc, configuration) {
return tokens;
} else {
const session = initSession(oidc.configurationName, configuration.storage ?? sessionStorage);
const {tokens} = await session.initAsync();
let {tokens} = await session.initAsync();
// @ts-ignore
tokens = setTokens(tokens, oidc.tokens, configuration.token_renew_mode);
return tokens;
}
}
Expand Down
1 change: 0 additions & 1 deletion packages/oidc-client/src/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { deriveChallengeAsync, generateRandom } from './crypto.js';
import { OidcAuthorizationServiceConfiguration } from './oidc.js';
import { parseOriginalTokens } from './parseTokens.js';
import { Fetch, StringMap } from './types.js';
import EC, {JWK, JWT} from './jwt';
import {ILOidcLocation} from "./location";

const oneHourSecond = 60 * 60;
Expand Down

0 comments on commit 819962b

Please sign in to comment.