Skip to content

Commit e573e4e

Browse files
Change magicAuthChallengedId to userId on authenticateUserWithMagicAuth (#850)
## Description * Updates to the latest state of the API. ## Documentation Does this require changes to the WorkOS Docs? E.g. the [API Reference](https://workos.com/docs/reference) or code snippets need updates. ``` [ ] Yes ``` If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required. Co-authored-by: Jônatas Santos <[email protected]>
1 parent 9d5d52d commit e573e4e

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/users/interfaces/authenticate-user-with-magic-auth-options.interface.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export interface AuthenticateUserWithMagicAuthOptions {
22
clientId: string;
33
code: string;
4-
magicAuthChallengeId: string;
4+
userId: string;
55
ipAddress?: string;
66
userAgent?: string;
77
}
@@ -15,7 +15,7 @@ export interface SerializedAuthenticateUserWithMagicAuthOptions {
1515
client_id: string;
1616
client_secret: string | undefined;
1717
code: string;
18-
magic_auth_challenge_id: string;
18+
user_id: string;
1919
ip_address?: string;
2020
user_agent?: string;
2121
}

src/users/serializers/authenticate-user-with-magic-auth-options.serializer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const serializeAuthenticateUserWithMagicAuthOptions = (
1212
client_id: options.clientId,
1313
client_secret: options.clientSecret,
1414
code: options.code,
15-
magic_auth_challenge_id: options.magicAuthChallengeId,
15+
user_id: options.userId,
1616
ip_address: options.ipAddress,
1717
user_agent: options.userAgent,
1818
});

src/users/users.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ describe('UserManagement', () => {
9999
const resp = await workos.users.authenticateUserWithMagicAuth({
100100
clientId: 'proj_whatever',
101101
code: '123456',
102-
magicAuthChallengeId: 'auth_challenge_123',
102+
userId: userFixture.id,
103103
});
104104

105105
expect(mock.history.post[0].url).toEqual('/users/authenticate');

0 commit comments

Comments
 (0)