Skip to content

Commit 747cfdf

Browse files
committed
remove startMfaSignIn step for TOTP.
TOTP only needs a finalize step.
1 parent 57c32b9 commit 747cfdf

File tree

2 files changed

+3
-30
lines changed

2 files changed

+3
-30
lines changed

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

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -51,27 +51,13 @@ 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-
}
6254

6355
export interface StartPhoneMfaSignInResponse {
6456
phoneResponseInfo: {
6557
sessionInfo: string;
6658
};
6759
}
6860

69-
export interface StartTotpMfaSignInResponse {
70-
totpSignInInfo: {
71-
verificationCode: string;
72-
};
73-
}
74-
7561
export function startSignInPhoneMfa(
7662
auth: Auth,
7763
request: StartPhoneMfaSignInRequest
@@ -87,27 +73,15 @@ export function startSignInPhoneMfa(
8773
);
8874
}
8975

90-
export function startSignInTotpMfa(
91-
auth: Auth,
92-
request: StartTotpMfaSignInRequest
93-
): Promise<StartTotpMfaSignInResponse> {
94-
return _performApiRequest<
95-
StartTotpMfaSignInRequest,
96-
StartTotpMfaSignInResponse
97-
>(
98-
auth,
99-
HttpMethod.POST,
100-
Endpoint.START_MFA_SIGN_IN,
101-
_addTidIfNecessary(auth, request)
102-
);
103-
}
104-
10576
export interface FinalizePhoneMfaSignInRequest {
10677
mfaPendingCredential: string;
10778
phoneVerificationInfo: SignInWithPhoneNumberRequest;
10879
tenantId?: string;
10980
}
11081

82+
// TOTP MFA Sign in only has a finalize phase. Phone MFA has a start phase to initiate sending an
83+
// SMS and a finalize phase to complete sign in. With TOTP, the user already has the OTP in the
84+
// TOTP/Authenticator app.
11185
export interface FinalizeTotpMfaSignInRequest {
11286
mfaPendingCredential: string;
11387
totpVerificationInfo: { verificationCode: string };

packages/auth/src/mfa/mfa_info.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ export abstract class MultiFactorInfoImpl implements MultiFactorInfo {
4848
if ('phoneInfo' in enrollment) {
4949
return PhoneMultiFactorInfoImpl._fromServerResponse(auth, enrollment);
5050
} else if ('totpInfo' in enrollment) {
51-
// TODO(prameshj) ensure that this field is set by the backend once the tracking bug is fixed.
5251
return TotpMultiFactorInfoImpl._fromServerResponse(auth, enrollment);
5352
}
5453
return _fail(auth, AuthErrorCode.INTERNAL_ERROR);

0 commit comments

Comments
 (0)