Skip to content

Commit 4e2f214

Browse files
Rename enrollUserInMfaFactor to enrollAuthFactor (#858)
## 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.
1 parent a7e1013 commit 4e2f214

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

src/users/interfaces/enroll-user-in-mfa-factor.interface.ts renamed to src/users/interfaces/enroll-auth-factor.interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export interface EnrollUserInMfaFactorOptions {
1+
export interface EnrollAuthFactorOptions {
22
userId: string;
33
type: 'totp';
44
totpIssuer: string;

src/users/interfaces/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export * from './reset-password-options.interface';
88
export * from './send-password-reset-options.interface';
99
export * from './create-user-options.interface';
1010
export * from './delete-user-options.interface';
11-
export * from './enroll-user-in-mfa-factor.interface';
11+
export * from './enroll-auth-factor.interface';
1212
export * from './list-users-options.interface';
1313
export * from './list-auth-factors-options.interface';
1414
export * from './remove-user-from-organization-options.interface';

src/users/serializers/enroll-user-in-mfa-factor-options.serializer.ts renamed to src/users/serializers/enroll-auth-factor-options.serializer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import {
2-
EnrollUserInMfaFactorOptions,
2+
EnrollAuthFactorOptions,
33
SerializedEnrollUserInMfaFactorOptions,
44
} from '../interfaces';
55

6-
export const serializeEnrollUserInMfaFactorOptions = (
7-
options: EnrollUserInMfaFactorOptions,
6+
export const serializeEnrollAuthFactorOptions = (
7+
options: EnrollAuthFactorOptions,
88
): SerializedEnrollUserInMfaFactorOptions => ({
99
type: options.type,
1010
totp_issuer: options.totpIssuer,

src/users/serializers/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export * from './authenticate-with-magic-auth-options.serializer';
33
export * from './authenticate-with-password-options.serializer';
44
export * from './authenticate-with-totp-options.serializer';
55
export * from './authentication-response.serializer';
6-
export * from './enroll-user-in-mfa-factor-options.serializer';
6+
export * from './enroll-auth-factor-options.serializer';
77
export * from './reset-password-options.serializer';
88
export * from './send-password-reset-email.serializer';
99
export * from './create-user-options.serializer';

src/users/users.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,8 @@ describe('UserManagement', () => {
407407
});
408408
});
409409

410-
describe('enrollUserInMfaFactor', () => {
411-
it('sends an enrollUserInMfaFactor request', async () => {
410+
describe('enrollAuthFactor', () => {
411+
it('sends an enrollAuthFactor request', async () => {
412412
mock.onPost(`/users/${userId}/auth/factors`).reply(200, {
413413
authentication_factor: factorFixture,
414414
authentication_challenge: {
@@ -422,7 +422,7 @@ describe('UserManagement', () => {
422422
},
423423
});
424424

425-
const resp = await workos.users.enrollUserInMfaFactor({
425+
const resp = await workos.users.enrollAuthFactor({
426426
userId,
427427
type: 'totp',
428428
totpIssuer: 'WorkOS',

src/users/users.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
SendPasswordResetEmailResponse,
1414
CreateUserOptions,
1515
DeleteUserOptions,
16-
EnrollUserInMfaFactorOptions,
16+
EnrollAuthFactorOptions,
1717
ListAuthFactorsOptions,
1818
ListUsersOptions,
1919
RemoveUserFromOrganizationOptions,
@@ -44,7 +44,7 @@ import {
4444
serializeAuthenticateWithPasswordOptions,
4545
serializeAuthenticateWithCodeOptions,
4646
serializeAuthenticateWithTotpOptions,
47-
serializeEnrollUserInMfaFactorOptions,
47+
serializeEnrollAuthFactorOptions,
4848
serializeResetPasswordOptions,
4949
serializeSendPasswordResetEmailOptions,
5050
serializeCreateUserOptions,
@@ -278,7 +278,7 @@ export class Users {
278278
return deserializeUser(data);
279279
}
280280

281-
async enrollUserInMfaFactor(payload: EnrollUserInMfaFactorOptions): Promise<{
281+
async enrollAuthFactor(payload: EnrollAuthFactorOptions): Promise<{
282282
authenticationFactor: Factor;
283283
authenticationChallenge: Challenge;
284284
}> {
@@ -287,7 +287,7 @@ export class Users {
287287
authentication_challenge: ChallengeResponse;
288288
}>(
289289
`/users/${payload.userId}/auth/factors`,
290-
serializeEnrollUserInMfaFactorOptions(payload),
290+
serializeEnrollAuthFactorOptions(payload),
291291
);
292292

293293
return {

0 commit comments

Comments
 (0)