Skip to content

Commit 4c9ce36

Browse files
committed
added startSignInTotp method
1 parent 6af3bde commit 4c9ce36

File tree

1 file changed

+30
-0
lines changed
  • packages/auth/src/api/authentication

1 file changed

+30
-0
lines changed

packages/auth/src/api/authentication/mfa.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,28 @@ export interface StartPhoneMfaSignInRequest {
5151
};
5252
tenantId?: string;
5353
}
54+
export interface StartTotpMfaSignInRequest {
55+
mfaPendingCredential: string;
56+
mfaEnrollmentId: string;
57+
TotpSignInInfo: {
58+
verificationCode: string;
59+
};
60+
tenantId?: string;
61+
}
62+
5463

5564
export interface StartPhoneMfaSignInResponse {
5665
phoneResponseInfo: {
5766
sessionInfo: string;
5867
};
5968
}
6069

70+
export interface StartTotpMfaSignInResponse {
71+
TotpSignInInfo: {
72+
verificationCode: string;
73+
};
74+
}
75+
6176
export function startSignInPhoneMfa(
6277
auth: Auth,
6378
request: StartPhoneMfaSignInRequest
@@ -73,6 +88,21 @@ export function startSignInPhoneMfa(
7388
);
7489
}
7590

91+
export function startSignInTotpMfa(
92+
auth: Auth,
93+
request: StartTotpMfaSignInRequest
94+
): Promise<StartTotpMfaSignInResponse> {
95+
return _performApiRequest<
96+
StartTotpMfaSignInRequest,
97+
StartTotpMfaSignInResponse
98+
>(
99+
auth,
100+
HttpMethod.POST,
101+
Endpoint.START_MFA_SIGN_IN,
102+
_addTidIfNecessary(auth, request)
103+
);
104+
}
105+
76106
export interface FinalizePhoneMfaSignInRequest {
77107
mfaPendingCredential: string;
78108
phoneVerificationInfo: SignInWithPhoneNumberRequest;

0 commit comments

Comments
 (0)