diff --git a/e2e/davinci-suites/src/phone-number-field.test.ts b/e2e/davinci-suites/src/phone-number-field.test.ts index 05cbcdd5d..2e55adbfb 100644 --- a/e2e/davinci-suites/src/phone-number-field.test.ts +++ b/e2e/davinci-suites/src/phone-number-field.test.ts @@ -27,7 +27,7 @@ test.describe('Device registration tests', () => { await page.goto('/?clientId=20dd0ed0-bb9b-4c8f-9a60-9ebeb4b348e0'); expect(page.url()).toContain( - 'http://localhost:5829/?clientId=20dd0ed0-bb9b-4c8f-9a60-9ebeb4b348e', + 'http://localhost:5829/?clientId=20dd0ed0-bb9b-4c8f-9a60-9ebeb4b348e0', ); await expect(page.getByText('Select Test Form')).toBeVisible(); diff --git a/packages/journey-client/src/index.ts b/packages/journey-client/src/index.ts index c51b07963..04d5c8309 100644 --- a/packages/journey-client/src/index.ts +++ b/packages/journey-client/src/index.ts @@ -6,3 +6,6 @@ */ export * from './lib/client.store.js'; + +// Re-export types from internal packages that consumers need +export { callbackType } from '@forgerock/sdk-types'; diff --git a/packages/journey-client/src/types.ts b/packages/journey-client/src/types.ts index ed7cade5f..5ec9b606c 100644 --- a/packages/journey-client/src/types.ts +++ b/packages/journey-client/src/types.ts @@ -13,7 +13,6 @@ export type { Callback, CallbackType, StepType, - callbackType, GenericError, PolicyRequirement, FailedPolicyRequirement, diff --git a/packages/oidc-client/src/lib/client.store.ts b/packages/oidc-client/src/lib/client.store.ts index 4c0bc8135..da6c3de99 100644 --- a/packages/oidc-client/src/lib/client.store.ts +++ b/packages/oidc-client/src/lib/client.store.ts @@ -128,9 +128,9 @@ export async function oidc({ }, /** - * @function background - Initiates the authorization process in the background, returning an authorization URL or an error. + * @function background - Initiates the authorization process in the background, returning code and state or an error. * @param {GetAuthorizationUrlOptions} options - Optional parameters to customize the authorization URL. - * @returns {Promise} - Returns a promise that resolves to the authorization URL or an error response. + * @returns {Promise} - Returns a promise that resolves to code and state or an error response. */ background: async ( options?: GetAuthorizationUrlOptions, @@ -289,16 +289,18 @@ export async function oidc({ options: storageOptions, }); }), - Micro.tap(async (tokens) => { - await store.dispatch( - oidcApi.endpoints.revoke.initiate({ - accessToken: tokens.accessToken, - clientId: config.clientId, - endpoint: wellknown.revocation_endpoint, - }), - ); - await storageClient.remove(); - await storageClient.set(tokens); + Micro.tap(async (newTokens) => { + if (tokens && 'accessToken' in tokens) { + await store.dispatch( + oidcApi.endpoints.revoke.initiate({ + accessToken: tokens.accessToken, + clientId: config.clientId, + endpoint: wellknown.revocation_endpoint, + }), + ); + await storageClient.remove(); + } + await storageClient.set(newTokens); }), );