UNPKG

@azure/msal-browser

Version:
51 lines (48 loc) • 2.54 kB
/*! @azure/msal-browser v5.30.0 2026-11-18 */ 'use strict'; import { CustomAuthFlowScenarioV2 } from '../auth_flow/v2/CustomAuthFlowScenarioV2.mjs'; import { AuthenticationFactorV2 } from '../network_client/custom_auth_api/v2/result/BaseResultsV2.mjs'; import { MFA_V2_RESEND_CHALLENGE, MFA_V2_SUBMIT_CHALLENGE, MFA_V2_SELECT_AUTH_METHOD, SIGN_UP_V2_COMPLETE, SIGN_UP_V2_SUBMIT_ATTRIBUTES, SIGN_UP_V2_RESEND_CODE, SIGN_UP_V2_SUBMIT_PASSWORD, SIGN_UP_V2_SUBMIT_CODE, SIGN_UP_V2_CHALLENGE, SIGN_IN_V2_COMPLETE, SIGN_IN_V2_SUBMIT_PASSWORD, SIGN_IN_V2_CHALLENGE, SIGN_IN_V2_SUBMIT_CODE, SIGN_IN_AFTER_PASSWORD_RESET, RESET_PASSWORD_V2_SUBMIT, RESET_PASSWORD_V2_RESEND_CODE, RESET_PASSWORD_V2_SUBMIT_CODE, RESET_PASSWORD_V2_CHALLENGE } from './PublicApiId.mjs'; /* * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ const FLOW_STEP_API_IDS_V2 = { [CustomAuthFlowScenarioV2.PasswordReset]: { requestChallenge: RESET_PASSWORD_V2_CHALLENGE, submitCode: RESET_PASSWORD_V2_SUBMIT_CODE, resendCode: RESET_PASSWORD_V2_RESEND_CODE, submitNewPassword: RESET_PASSWORD_V2_SUBMIT, signInWithContinuation: SIGN_IN_AFTER_PASSWORD_RESET, }, [CustomAuthFlowScenarioV2.SignIn]: { requestChallenge: SIGN_IN_V2_CHALLENGE, submitCode: SIGN_IN_V2_SUBMIT_CODE, resendCode: SIGN_IN_V2_CHALLENGE, submitPassword: SIGN_IN_V2_SUBMIT_PASSWORD, signInWithContinuation: SIGN_IN_V2_COMPLETE, }, [CustomAuthFlowScenarioV2.SignUp]: { requestChallenge: SIGN_UP_V2_CHALLENGE, submitCode: SIGN_UP_V2_SUBMIT_CODE, submitPassword: SIGN_UP_V2_SUBMIT_PASSWORD, resendCode: SIGN_UP_V2_RESEND_CODE, submitAttributes: SIGN_UP_V2_SUBMIT_ATTRIBUTES, signInWithContinuation: SIGN_UP_V2_COMPLETE, }, }; const MFA_STEP_API_IDS_V2 = { requestChallenge: MFA_V2_SELECT_AUTH_METHOD, submitCode: MFA_V2_SUBMIT_CHALLENGE, resendCode: MFA_V2_RESEND_CHALLENGE, }; function getPublicApiIdV2(scenario, step, authenticationFactor) { if ((scenario === CustomAuthFlowScenarioV2.SignIn || scenario === CustomAuthFlowScenarioV2.PasswordReset) && authenticationFactor === AuthenticationFactorV2.MULTI_FACTOR) { return (MFA_STEP_API_IDS_V2[step] ?? FLOW_STEP_API_IDS_V2[scenario]?.[step]); } return FLOW_STEP_API_IDS_V2[scenario]?.[step]; } export { getPublicApiIdV2 }; //# sourceMappingURL=FlowApiIdHelperV2.mjs.map