@azure/msal-browser
Version:
Microsoft Authentication Library for js
49 lines (46 loc) • 2.03 kB
JavaScript
/*! @azure/msal-browser v5.30.0 2026-11-18 */
;
import { AuthFlowActionRequiredStateBase } from '../../../../core/auth_flow/AuthFlowState.mjs';
import { CustomAuthResultV2 } from '../../../../core/auth_flow/v2/CustomAuthResultV2.mjs';
import { handleExistingAccountVerificationResultV2 } from './ExistingAccountStateTransitionHelperV2.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* State returned when sign-up discovers an existing account that requires its
* current password. The password is verified as an authentication credential.
*/
class ExistingAccountPasswordRequiredStateV2 extends AuthFlowActionRequiredStateBase {
constructor() {
super(...arguments);
this.stateType = "existingAccountPasswordRequired";
}
/**
* Verifies the existing account's current password and continues authentication.
* The result can complete authentication or require enrollment or MFA.
* @param password - The existing account password.
* @returns The next existing-account authentication result.
*/
async submitPassword(password) {
const { correlationId, logger, continuationState, flowClient } = this.stateParameters;
try {
this.ensurePasswordIsNotEmpty(password);
const result = await flowClient.submitSignInPassword({
correlationId,
continuationState,
password,
});
return handleExistingAccountVerificationResultV2(result, this.stateParameters);
}
catch (error) {
logger.errorPii(`1glycw ${error}`, correlationId);
return CustomAuthResultV2.createWithError(error, {
scenario: continuationState.scenario,
correlationId,
});
}
}
}
export { ExistingAccountPasswordRequiredStateV2 };
//# sourceMappingURL=ExistingAccountPasswordRequiredStateV2.mjs.map