Skip to content

Commit

Permalink
Merge pull request #164 from adrienne-deriv/add-state-parameter-new
Browse files Browse the repository at this point in the history
Adrienne / Fix user state not being shown
  • Loading branch information
adrienne-deriv authored Feb 27, 2025
2 parents e873a2a + 3d53e0f commit 12a424e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/components/Callback/Callback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,10 @@ export const Callback = ({

const fetchTokens = useCallback(async () => {
try {
const { accessToken, userManager } = await requestOidcToken({
const { accessToken, user } = await requestOidcToken({
redirectCallbackUri,
postLogoutRedirectUri,
});
const user = await userManager.getUser();

if (accessToken) {
onRequestOidcTokenSuccess?.(accessToken, user?.state);
Expand Down
2 changes: 1 addition & 1 deletion src/oidc/oidc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export const requestOidcToken = async (options: RequestOidcTokenOptions) => {

return {
accessToken: user?.access_token,
userManager,
user,
};
} catch (error) {
console.error('unable to request access tokens: ', error);
Expand Down

0 comments on commit 12a424e

Please sign in to comment.