Skip to content

Commit

Permalink
fix(oidc): user loaded 401 when preload true and not serviceworder mo…
Browse files Browse the repository at this point in the history
…de (release)
  • Loading branch information
guillaume-chervet committed May 19, 2024
1 parent d764b2b commit 8d9fd95
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/react-oidc-demo/src/configurations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const configurationIdentityServer = {
authority: 'https://demo.duendesoftware.com',
// authority_time_cache_wellknowurl_in_second: 60* 60,
refresh_time_before_tokens_expiration_in_second: 40,
service_worker_relative_url: '/OidcServiceWorker.js',
// service_worker_relative_url: '/OidcServiceWorker.js',
service_worker_only: false,
// storage: localStorage,
// silent_login_timeout: 3333000
Expand Down
3 changes: 0 additions & 3 deletions packages/oidc-client/src/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,6 @@ export const loginCallbackAsync = (oidc:Oidc) => async (isSilentSignin = false)
}

await oidc.startCheckSessionAsync(oidcServerConfiguration.checkSessionIframe, clientId, sessionState, isSilentSignin);
if(configuration.preload_user_info){
await oidc.userInfoAsync();
}
oidc.publishEvent(eventNames.loginCallbackAsync_end, {});
return {
tokens: formattedTokens,
Expand Down
3 changes: 3 additions & 0 deletions packages/oidc-client/src/oidc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,9 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
session.setTokens(parsedTokens);
}
this.publishEvent(Oidc.eventNames.token_aquired, parsedTokens);
if(this.configuration.preload_user_info){
await this.userInfoAsync();
}
// @ts-ignore
return { parsedTokens, state: response.state, callbackPath: response.callbackPath };
};
Expand Down

0 comments on commit 8d9fd95

Please sign in to comment.