An object representing an Authentication Factor.
const factor = { object: 'authentication_factor', id: 'auth_factor_01FVYZ5QM8N98T9ME5BCB2BBMJ', createdAt: '2022-02-15T15:14:19.392Z', updatedAt: '2022-02-15T15:14:19.392Z', type: 'totp', totp: { qrCode: 'data:image/png;base64,{base64EncodedPng}', secret: 'NAGCCFS3EYRB422HNAKAKY3XDUORMSRF', uri: 'otpauth://totp/FooCorp:alan.turing@example.com?secret=NAGCCFS3EYRB422HNAKAKY3XDUORMSRF&issuer=FooCorp', }, };
interface FactorEnrolls an Authentication Factor to be used as an additional factor of authentication. The returned ID should be used to create an authentication Challenge.
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_example_123456789'); const factor = await workos.mfa.enrollFactor({ type: 'totp', issuer: 'Foo Corp', user: 'alan.turing@example.com', });
Gets an Authentication Factor.
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_example_123456789'); const factor = await workos.mfa.getFactor( 'auth_factor_01FVYZ5QM8N98T9ME5BCB2BBMJ', );
Permanently deletes an Authentication Factor. It cannot be undone.
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_example_123456789'); await workos.mfa.deleteFactor('auth_factor_01FVYZ5QM8N98T9ME5BCB2BBMJ');
mfa .deleteFactor()Parameters