Skip to content

Commit eb396a5

Browse files
committed
fix: pass token string and not the object with payload
1 parent 0d3aa28 commit eb396a5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/__tests__/sdk/oauth2-flows/ClientCredentials.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,14 @@ describe('ClientCredentials', () => {
142142
it('commits access token to memory, when a new one is fetched', async () => {
143143
const mockAccessToken = mocks.getMockAccessToken(clientConfig.authDomain);
144144
mocks.fetchClient.mockResolvedValue({
145-
json: () => ({ access_token: mockAccessToken }),
145+
json: () => ({ access_token: mockAccessToken.token }),
146146
});
147147

148148
const client = new ClientCredentials(clientConfig);
149149
await client.getToken(sessionManager);
150150
expect(mocks.fetchClient).toHaveBeenCalledTimes(1);
151151
expect(await sessionManager.getSessionItem('access_token')).toBe(
152-
mockAccessToken
152+
mockAccessToken.token
153153
);
154154
});
155155
});

0 commit comments

Comments
 (0)