Skip to content

Commit

Permalink
All authentication methods should pass ipAddress and userAgent (#861
Browse files Browse the repository at this point in the history
)

## Description

## 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.
  • Loading branch information
jonatascastro12 authored Sep 12, 2023
1 parent 11ddad5 commit 0e88cda
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
export interface AuthenticateWithCodeOptions {
clientId: string;
code: string;
ipAddress?: string;
userAgent?: string;
}

export interface AuthenticateUserWithCodeCredentials {
Expand All @@ -12,4 +14,6 @@ export interface SerializedAuthenticateWithCodeOptions {
client_id: string;
client_secret: string | undefined;
code: string;
ip_address?: string;
user_agent?: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ export interface AuthenticateWithTotpOptions {
code: string;
pendingAuthenticationToken: string;
authenticationChallengeId: string;
ipAddress?: string;
userAgent?: string;
}

export interface AuthenticateUserWithTotpCredentials {
Expand All @@ -16,4 +18,6 @@ export interface SerializedAuthenticateWithTotpOptions {
code: string;
pending_authentication_token: string;
authentication_challenge_id: string;
ip_address?: string;
user_agent?: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ export const serializeAuthenticateWithCodeOptions = (
client_id: options.clientId,
client_secret: options.clientSecret,
code: options.code,
ip_address: options.ipAddress,
user_agent: options.userAgent,
});
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {} from '../interfaces';
import {
AuthenticateUserWithTotpCredentials,
AuthenticateWithTotpOptions,
SerializedAuthenticateWithTotpOptions,
} from '../interfaces/authenticate-with-totp-options.interface';
} from '../interfaces';

export const serializeAuthenticateWithTotpOptions = (
options: AuthenticateWithTotpOptions & AuthenticateUserWithTotpCredentials,
Expand All @@ -14,4 +13,6 @@ export const serializeAuthenticateWithTotpOptions = (
code: options.code,
authentication_challenge_id: options.authenticationChallengeId,
pending_authentication_token: options.pendingAuthenticationToken,
ip_address: options.ipAddress,
user_agent: options.userAgent,
});

0 comments on commit 0e88cda

Please sign in to comment.