chore: apply requested changes (#1442)

This commit is contained in:
Ralph Khreish
2025-11-24 23:00:13 +01:00
committed by GitHub
parent 0195feffee
commit 01d4d9930f
7 changed files with 53 additions and 17 deletions

View File

@@ -551,13 +551,15 @@ Examples:
private async handleMFAVerification(
mfaError: AuthenticationError
): Promise<AuthCredentials> {
if (!mfaError.mfaChallenge) {
if (!mfaError.mfaChallenge?.factorId) {
throw new AuthenticationError(
'MFA challenge information missing',
'MFA_VERIFICATION_FAILED'
);
}
const { factorId } = mfaError.mfaChallenge;
console.log(
chalk.yellow(
'\n⚠ Multi-factor authentication is enabled on your account'
@@ -571,7 +573,7 @@ Examples:
// Use @tm/core's retry logic - presentation layer just handles UI
const result = await this.authManager.verifyMFAWithRetry(
mfaError.mfaChallenge.factorId,
factorId,
async () => {
// Prompt for MFA code
try {