Skip to content

Commit

Permalink
Change magicAuthChallengedId to userId on authenticateUserWithMagicAu…
Browse files Browse the repository at this point in the history
…th (#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]>
  • Loading branch information
willmanduffy and jonatascastro12 authored Sep 1, 2023
1 parent 9d5d52d commit e573e4e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export interface AuthenticateUserWithMagicAuthOptions {
clientId: string;
code: string;
magicAuthChallengeId: string;
userId: string;
ipAddress?: string;
userAgent?: string;
}
Expand All @@ -15,7 +15,7 @@ export interface SerializedAuthenticateUserWithMagicAuthOptions {
client_id: string;
client_secret: string | undefined;
code: string;
magic_auth_challenge_id: string;
user_id: string;
ip_address?: string;
user_agent?: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const serializeAuthenticateUserWithMagicAuthOptions = (
client_id: options.clientId,
client_secret: options.clientSecret,
code: options.code,
magic_auth_challenge_id: options.magicAuthChallengeId,
user_id: options.userId,
ip_address: options.ipAddress,
user_agent: options.userAgent,
});
2 changes: 1 addition & 1 deletion src/users/users.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ describe('UserManagement', () => {
const resp = await workos.users.authenticateUserWithMagicAuth({
clientId: 'proj_whatever',
code: '123456',
magicAuthChallengeId: 'auth_challenge_123',
userId: userFixture.id,
});

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

0 comments on commit e573e4e

Please sign in to comment.