@azure/msal-browser 5.28.0 → 5.29.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (507) hide show
  1. package/dist/app/IPublicClientApplication.mjs +1 -1
  2. package/dist/app/PublicClientApplication.mjs +1 -1
  3. package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
  4. package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs +1 -1
  5. package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +1 -1
  6. package/dist/broker/nativeBroker/PlatformAuthProvider.mjs +1 -1
  7. package/dist/broker/nativeBroker/PlatformAuthRequest.mjs +1 -1
  8. package/dist/cache/AccountManager.mjs +1 -1
  9. package/dist/cache/AsyncMemoryStorage.mjs +1 -1
  10. package/dist/cache/BrowserCacheManager.mjs +1 -1
  11. package/dist/cache/CacheHelpers.mjs +1 -1
  12. package/dist/cache/CacheKeys.mjs +1 -1
  13. package/dist/cache/CookieStorage.mjs +1 -1
  14. package/dist/cache/DatabaseStorage.mjs +1 -1
  15. package/dist/cache/EncryptedData.mjs +1 -1
  16. package/dist/cache/LocalStorage.mjs +1 -1
  17. package/dist/cache/MemoryStorage.mjs +1 -1
  18. package/dist/cache/SessionStorage.mjs +1 -1
  19. package/dist/cache/TokenCache.mjs +1 -1
  20. package/dist/config/Configuration.mjs +1 -1
  21. package/dist/controllers/NestedAppAuthController.mjs +1 -1
  22. package/dist/controllers/StandardController.mjs +1 -1
  23. package/dist/crypto/BrowserCrypto.mjs +1 -1
  24. package/dist/crypto/CryptoOps.mjs +1 -1
  25. package/dist/crypto/PkceGenerator.mjs +1 -1
  26. package/dist/crypto/SignedHttpRequest.mjs +1 -1
  27. package/dist/crypto/TokenBindingKeyManager.mjs +1 -1
  28. package/dist/custom_auth/CustomAuthConstants.mjs +1 -1
  29. package/dist/custom_auth/CustomAuthPublicClientApplication.mjs +6 -4
  30. package/dist/custom_auth/CustomAuthPublicClientApplication.mjs.map +1 -1
  31. package/dist/custom_auth/controller/CustomAuthStandardController.mjs +58 -62
  32. package/dist/custom_auth/controller/CustomAuthStandardController.mjs.map +1 -1
  33. package/dist/custom_auth/core/CustomAuthAuthority.mjs +1 -1
  34. package/dist/custom_auth/core/auth_flow/AuthFlowErrorBase.mjs +1 -1
  35. package/dist/custom_auth/core/auth_flow/AuthFlowResultBase.mjs +1 -1
  36. package/dist/custom_auth/core/auth_flow/AuthFlowState.mjs +1 -1
  37. package/dist/custom_auth/core/auth_flow/AuthFlowStateTypes.mjs +1 -1
  38. package/dist/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.mjs +1 -1
  39. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.mjs +1 -1
  40. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.mjs +1 -1
  41. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.mjs +1 -1
  42. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.mjs +1 -1
  43. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.mjs +1 -1
  44. package/dist/custom_auth/core/auth_flow/mfa/error_type/MfaError.mjs +1 -1
  45. package/dist/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.mjs +1 -1
  46. package/dist/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.mjs +1 -1
  47. package/dist/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.mjs +1 -1
  48. package/dist/custom_auth/core/auth_flow/mfa/state/MfaFailedState.mjs +1 -1
  49. package/dist/custom_auth/core/auth_flow/mfa/state/MfaState.mjs +1 -1
  50. package/dist/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.mjs +3 -5
  51. package/dist/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.mjs.map +1 -1
  52. package/dist/custom_auth/core/auth_flow/v2/CustomAuthResultV2.mjs +19 -13
  53. package/dist/custom_auth/core/auth_flow/v2/CustomAuthResultV2.mjs.map +1 -1
  54. package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.mjs +8 -2
  55. package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.mjs.map +1 -1
  56. package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.mjs +58 -69
  57. package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.mjs.map +1 -1
  58. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.mjs +3 -3
  59. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.mjs +42 -15
  60. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.mjs.map +1 -1
  61. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.mjs +17 -4
  62. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.mjs.map +1 -1
  63. package/dist/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.mjs +1 -1
  64. package/dist/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.mjs +14 -18
  65. package/dist/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.mjs.map +1 -1
  66. package/dist/custom_auth/core/auth_flow/v2/state/CompletedStateV2.mjs +2 -4
  67. package/dist/custom_auth/core/auth_flow/v2/state/CompletedStateV2.mjs.map +1 -1
  68. package/dist/custom_auth/core/auth_flow/v2/state/FailedStateV2.mjs +2 -3
  69. package/dist/custom_auth/core/auth_flow/v2/state/FailedStateV2.mjs.map +1 -1
  70. package/dist/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.mjs +17 -6
  71. package/dist/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.mjs.map +1 -1
  72. package/dist/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.mjs +110 -0
  73. package/dist/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.mjs.map +1 -0
  74. package/dist/custom_auth/core/error/CustomAuthApiError.mjs +1 -1
  75. package/dist/custom_auth/core/error/CustomAuthError.mjs +1 -1
  76. package/dist/custom_auth/core/error/HttpError.mjs +1 -1
  77. package/dist/custom_auth/core/error/HttpErrorCodes.mjs +1 -1
  78. package/dist/custom_auth/core/error/InvalidArgumentError.mjs +2 -1
  79. package/dist/custom_auth/core/error/InvalidArgumentError.mjs.map +1 -1
  80. package/dist/custom_auth/core/error/InvalidConfigurationError.mjs +1 -1
  81. package/dist/custom_auth/core/error/InvalidConfigurationErrorCodes.mjs +1 -1
  82. package/dist/custom_auth/core/error/MethodNotImplementedError.mjs +1 -1
  83. package/dist/custom_auth/core/error/MsalCustomAuthError.mjs +1 -1
  84. package/dist/custom_auth/core/error/NoCachedAccountFoundError.mjs +1 -1
  85. package/dist/custom_auth/core/error/ParsedUrlError.mjs +1 -1
  86. package/dist/custom_auth/core/error/ParsedUrlErrorCodes.mjs +1 -1
  87. package/dist/custom_auth/core/error/UnexpectedError.mjs +1 -1
  88. package/dist/custom_auth/core/error/UnsupportedEnvironmentError.mjs +1 -1
  89. package/dist/custom_auth/core/error/UserAccountAttributeError.mjs +1 -1
  90. package/dist/custom_auth/core/error/UserAlreadySignedInError.mjs +1 -1
  91. package/dist/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.mjs +1 -1
  92. package/dist/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.mjs +1 -1
  93. package/dist/custom_auth/core/interaction_client/jit/JitClient.mjs +1 -1
  94. package/dist/custom_auth/core/interaction_client/jit/result/JitActionResult.mjs +1 -1
  95. package/dist/custom_auth/core/interaction_client/mfa/MfaClient.mjs +1 -1
  96. package/dist/custom_auth/core/interaction_client/mfa/result/MfaActionResult.mjs +1 -1
  97. package/dist/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.mjs +256 -150
  98. package/dist/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.mjs.map +1 -1
  99. package/dist/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.mjs +2 -6
  100. package/dist/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.mjs.map +1 -1
  101. package/dist/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.mjs +10 -3
  102. package/dist/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.mjs.map +1 -1
  103. package/dist/custom_auth/core/network_client/custom_auth_api/BaseApiClient.mjs +1 -1
  104. package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.mjs +1 -1
  105. package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.mjs +1 -1
  106. package/dist/custom_auth/core/network_client/custom_auth_api/RegisterApiClient.mjs +1 -1
  107. package/dist/custom_auth/core/network_client/custom_auth_api/ResetPasswordApiClient.mjs +1 -1
  108. package/dist/custom_auth/core/network_client/custom_auth_api/SignInApiClient.mjs +1 -1
  109. package/dist/custom_auth/core/network_client/custom_auth_api/SignupApiClient.mjs +1 -1
  110. package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.mjs +1 -1
  111. package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.mjs +1 -1
  112. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.mjs +1 -7
  113. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.mjs.map +1 -1
  114. package/dist/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.mjs +1 -1
  115. package/dist/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.mjs +35 -19
  116. package/dist/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.mjs.map +1 -1
  117. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ErrorCodesV2.mjs +1 -1
  118. package/dist/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.mjs +1 -1
  119. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.mjs +20 -9
  120. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.mjs.map +1 -1
  121. package/dist/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorNormalizerV2.mjs +1 -1
  122. package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.mjs +1 -1
  123. package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.mjs.map +1 -1
  124. package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.mjs +1 -2
  125. package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.mjs.map +1 -1
  126. package/dist/custom_auth/core/network_client/http_client/FetchHttpClient.mjs +1 -1
  127. package/dist/custom_auth/core/network_client/http_client/IHttpClient.mjs +1 -1
  128. package/dist/custom_auth/core/telemetry/FlowApiIdHelperV2.mjs +5 -7
  129. package/dist/custom_auth/core/telemetry/FlowApiIdHelperV2.mjs.map +1 -1
  130. package/dist/custom_auth/core/telemetry/PublicApiId.mjs +3 -2
  131. package/dist/custom_auth/core/telemetry/PublicApiId.mjs.map +1 -1
  132. package/dist/custom_auth/core/utils/ArgumentValidator.mjs +17 -2
  133. package/dist/custom_auth/core/utils/ArgumentValidator.mjs.map +1 -1
  134. package/dist/custom_auth/core/utils/CustomHeaderUtils.mjs +1 -1
  135. package/dist/custom_auth/core/utils/UrlUtils.mjs +1 -1
  136. package/dist/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs +1 -1
  137. package/dist/custom_auth/get_account/auth_flow/error_type/GetAccountError.mjs +1 -1
  138. package/dist/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.mjs +1 -1
  139. package/dist/custom_auth/get_account/auth_flow/result/GetAccountResult.mjs +1 -1
  140. package/dist/custom_auth/get_account/auth_flow/result/SignOutResult.mjs +1 -1
  141. package/dist/custom_auth/get_account/auth_flow/state/GetAccessTokenState.mjs +1 -1
  142. package/dist/custom_auth/get_account/auth_flow/state/GetAccountState.mjs +1 -1
  143. package/dist/custom_auth/get_account/auth_flow/state/SignOutState.mjs +1 -1
  144. package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs +1 -1
  145. package/dist/custom_auth/index.mjs +4 -3
  146. package/dist/custom_auth/index.mjs.map +1 -1
  147. package/dist/custom_auth/operating_context/CustomAuthOperatingContext.mjs +1 -1
  148. package/dist/custom_auth/reset_password/auth_flow/error_type/ResetPasswordError.mjs +1 -1
  149. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.mjs +1 -1
  150. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.mjs +1 -1
  151. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.mjs +1 -1
  152. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.mjs +1 -1
  153. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.mjs +1 -1
  154. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.mjs +1 -1
  155. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.mjs +1 -1
  156. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.mjs +1 -1
  157. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordState.mjs +1 -1
  158. package/dist/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.mjs +23 -7
  159. package/dist/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.mjs.map +1 -1
  160. package/dist/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateTransitionHandlerV2.mjs +24 -0
  161. package/dist/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateTransitionHandlerV2.mjs.map +1 -0
  162. package/dist/custom_auth/reset_password/interaction_client/ResetPasswordClient.mjs +1 -1
  163. package/dist/custom_auth/sign_in/auth_flow/SignInScenario.mjs +1 -1
  164. package/dist/custom_auth/sign_in/auth_flow/error_type/SignInError.mjs +1 -1
  165. package/dist/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.mjs +1 -1
  166. package/dist/custom_auth/sign_in/auth_flow/result/SignInResult.mjs +1 -1
  167. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs +1 -1
  168. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs +1 -1
  169. package/dist/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs +1 -1
  170. package/dist/custom_auth/sign_in/auth_flow/state/SignInCompletedState.mjs +1 -1
  171. package/dist/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs +1 -1
  172. package/dist/custom_auth/sign_in/auth_flow/state/SignInFailedState.mjs +1 -1
  173. package/dist/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs +1 -1
  174. package/dist/custom_auth/sign_in/auth_flow/state/SignInState.mjs +1 -1
  175. package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.mjs +4 -7
  176. package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.mjs.map +1 -1
  177. package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.mjs +2 -2
  178. package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.mjs.map +1 -1
  179. package/dist/custom_auth/sign_in/interaction_client/SignInClient.mjs +1 -1
  180. package/dist/custom_auth/sign_in/interaction_client/result/SignInActionResult.mjs +1 -1
  181. package/dist/custom_auth/sign_up/auth_flow/error_type/SignUpError.mjs +1 -1
  182. package/dist/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.mjs +1 -1
  183. package/dist/custom_auth/sign_up/auth_flow/result/SignUpResult.mjs +1 -1
  184. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.mjs +1 -1
  185. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.mjs +1 -1
  186. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.mjs +1 -1
  187. package/dist/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.mjs +1 -1
  188. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.mjs +1 -1
  189. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.mjs +1 -1
  190. package/dist/custom_auth/sign_up/auth_flow/state/SignUpFailedState.mjs +1 -1
  191. package/dist/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.mjs +1 -1
  192. package/dist/custom_auth/sign_up/auth_flow/state/SignUpState.mjs +1 -1
  193. package/dist/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.mjs +17 -8
  194. package/dist/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.mjs.map +1 -1
  195. package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountCodeRequiredStateV2.mjs +78 -0
  196. package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountCodeRequiredStateV2.mjs.map +1 -0
  197. package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountPasswordRequiredStateV2.mjs +48 -0
  198. package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountPasswordRequiredStateV2.mjs.map +1 -0
  199. package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountStateTransitionHelperV2.mjs +49 -0
  200. package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountStateTransitionHelperV2.mjs.map +1 -0
  201. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.mjs +17 -24
  202. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.mjs.map +1 -1
  203. package/dist/custom_auth/sign_up/interaction_client/SignUpClient.mjs +1 -1
  204. package/dist/custom_auth/sign_up/interaction_client/result/SignUpActionResult.mjs +1 -1
  205. package/dist/encode/Base64Decode.mjs +1 -1
  206. package/dist/encode/Base64Encode.mjs +1 -1
  207. package/dist/error/BrowserAuthError.mjs +1 -1
  208. package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
  209. package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
  210. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
  211. package/dist/error/NativeAuthError.mjs +1 -1
  212. package/dist/error/NativeAuthErrorCodes.mjs +1 -1
  213. package/dist/error/NestedAppAuthError.mjs +1 -1
  214. package/dist/event/EventHandler.mjs +1 -1
  215. package/dist/event/EventMessage.mjs +1 -1
  216. package/dist/event/EventType.mjs +1 -1
  217. package/dist/index.mjs +1 -1
  218. package/dist/interaction_client/BaseInteractionClient.mjs +1 -1
  219. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  220. package/dist/interaction_client/PlatformAuthInteractionClient.mjs +38 -31
  221. package/dist/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -1
  222. package/dist/interaction_client/PopupClient.mjs +1 -1
  223. package/dist/interaction_client/RedirectClient.mjs +6 -2
  224. package/dist/interaction_client/RedirectClient.mjs.map +1 -1
  225. package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
  226. package/dist/interaction_client/SilentCacheClient.mjs +1 -1
  227. package/dist/interaction_client/SilentIframeClient.mjs +1 -1
  228. package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
  229. package/dist/interaction_client/StandardInteractionClient.mjs +5 -1
  230. package/dist/interaction_client/StandardInteractionClient.mjs.map +1 -1
  231. package/dist/interaction_handler/InteractionHandler.mjs +1 -1
  232. package/dist/interaction_handler/SilentHandler.mjs +1 -1
  233. package/dist/log-strings-mapping.json +21 -9
  234. package/dist/naa/BridgeError.mjs +1 -1
  235. package/dist/naa/BridgeProxy.mjs +1 -1
  236. package/dist/naa/BridgeStatusCode.mjs +1 -1
  237. package/dist/naa/mapping/NestedAppAuthAdapter.mjs +1 -1
  238. package/dist/navigation/NavigationClient.mjs +1 -1
  239. package/dist/network/FetchClient.mjs +1 -1
  240. package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
  241. package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
  242. package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
  243. package/dist/packageMetadata.mjs +2 -2
  244. package/dist/popup_relay/constants.mjs +1 -1
  245. package/dist/popup_relay/index.mjs +1 -1
  246. package/dist/popup_relay/relayClient.mjs +1 -1
  247. package/dist/protocol/Authorize.mjs +1 -1
  248. package/dist/redirect_bridge/index.mjs +1 -1
  249. package/dist/request/RequestHelpers.mjs +1 -1
  250. package/dist/request/SilentRequestHelpers.mjs +1 -1
  251. package/dist/response/ResponseHandler.mjs +1 -1
  252. package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
  253. package/dist/telemetry/BrowserPerformanceEvents.mjs +1 -1
  254. package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
  255. package/dist/telemetry/BrowserRootPerformanceEvents.mjs +1 -1
  256. package/dist/utils/BrowserConstants.mjs +1 -1
  257. package/dist/utils/BrowserDetection.mjs +1 -1
  258. package/dist/utils/BrowserProtocolUtils.mjs +1 -1
  259. package/dist/utils/BrowserUtils.mjs +1 -1
  260. package/dist/utils/Helpers.mjs +1 -1
  261. package/dist/utils/IframeMonitor.mjs +1 -1
  262. package/dist/utils/MsalFrameStatsUtils.mjs +1 -1
  263. package/dist/utils/PopupMonitor.mjs +1 -1
  264. package/dist/utils/PopupOriginCheck.mjs +1 -1
  265. package/dist/webBrokerBridge/PendingRequestRegistry.mjs +1 -1
  266. package/dist/webBrokerBridge/PerfEventNames.mjs +1 -1
  267. package/dist/webBrokerBridge/WebBrokerBridgeError.mjs +1 -1
  268. package/dist/webBrokerBridge/WebBrokerBridgeErrorMap.mjs +1 -1
  269. package/dist/webBrokerBridge/adapter/CrossVersionRequestAdapter.mjs +1 -1
  270. package/dist/webBrokerBridge/index.mjs +1 -1
  271. package/lib/custom-auth-path/log-strings-mapping.json +21 -9
  272. package/lib/custom-auth-path/msal-custom-auth.cjs +1160 -765
  273. package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
  274. package/lib/custom-auth-path/msal-custom-auth.js +1160 -765
  275. package/lib/custom-auth-path/msal-custom-auth.js.map +1 -1
  276. package/lib/log-strings-mapping.json +7 -3
  277. package/lib/msal-browser.cjs +187 -117
  278. package/lib/msal-browser.cjs.map +1 -1
  279. package/lib/msal-browser.js +187 -117
  280. package/lib/msal-browser.js.map +1 -1
  281. package/lib/msal-browser.min.js +2 -2
  282. package/lib/popup-relay/msal-popup-relay.cjs +2 -2
  283. package/lib/popup-relay/msal-popup-relay.cjs.map +1 -1
  284. package/lib/popup-relay/msal-popup-relay.js +2 -2
  285. package/lib/popup-relay/msal-popup-relay.js.map +1 -1
  286. package/lib/popup-relay/msal-popup-relay.min.js +1 -1
  287. package/lib/redirect-bridge/msal-redirect-bridge.cjs +39 -10
  288. package/lib/redirect-bridge/msal-redirect-bridge.cjs.map +1 -1
  289. package/lib/redirect-bridge/msal-redirect-bridge.js +39 -10
  290. package/lib/redirect-bridge/msal-redirect-bridge.js.map +1 -1
  291. package/lib/redirect-bridge/msal-redirect-bridge.min.js +2 -2
  292. package/lib/web-broker-bridge/msal-web-broker-bridge.cjs +1 -1
  293. package/package.json +2 -2
  294. package/src/custom_auth/CustomAuthActionInputs.ts +12 -5
  295. package/src/custom_auth/CustomAuthPublicClientApplication.ts +5 -3
  296. package/src/custom_auth/ICustomAuthPublicClientApplicationV2.ts +5 -3
  297. package/src/custom_auth/controller/CustomAuthStandardController.ts +79 -110
  298. package/src/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.ts +1 -2
  299. package/src/custom_auth/core/auth_flow/v2/AuthenticationMethodV2.ts +1 -4
  300. package/src/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.ts +5 -4
  301. package/src/custom_auth/core/auth_flow/v2/CustomAuthResultV2.ts +28 -16
  302. package/src/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.ts +6 -0
  303. package/src/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.ts +83 -72
  304. package/src/custom_auth/core/auth_flow/v2/result/AuthMethodRegistrationChallengeResultV2.ts +3 -3
  305. package/src/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.ts +7 -5
  306. package/src/custom_auth/core/auth_flow/v2/result/MFASubmitChallengeResultV2.ts +10 -6
  307. package/src/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.ts +9 -6
  308. package/src/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.ts +4 -6
  309. package/src/custom_auth/core/auth_flow/v2/result/SubmitPasswordResultV2.ts +36 -0
  310. package/src/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.ts +6 -8
  311. package/src/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.ts +2 -2
  312. package/src/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.ts +61 -12
  313. package/src/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.ts +21 -3
  314. package/src/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.ts +30 -24
  315. package/src/custom_auth/core/auth_flow/v2/state/CompletedStateV2.ts +1 -3
  316. package/src/custom_auth/core/auth_flow/v2/state/CustomAuthStateParametersV2.ts +11 -2
  317. package/src/custom_auth/core/auth_flow/v2/state/FailedStateV2.ts +1 -2
  318. package/src/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.ts +26 -7
  319. package/src/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.ts +179 -0
  320. package/src/custom_auth/core/error/InvalidArgumentError.ts +1 -1
  321. package/src/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.ts +12 -12
  322. package/src/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.ts +394 -238
  323. package/src/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.ts +2 -6
  324. package/src/custom_auth/core/interaction_client/v2/parameter/FlowParamsV2.ts +2 -15
  325. package/src/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.ts +63 -26
  326. package/src/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.ts +0 -6
  327. package/src/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.ts +74 -26
  328. package/src/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.ts +48 -9
  329. package/src/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.ts +4 -6
  330. package/src/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorResponsesV2.ts +0 -6
  331. package/src/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.ts +14 -53
  332. package/src/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.ts +0 -18
  333. package/src/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.ts +32 -13
  334. package/src/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.ts +8 -9
  335. package/src/custom_auth/core/telemetry/FlowApiIdHelperV2.ts +4 -5
  336. package/src/custom_auth/core/telemetry/PublicApiId.ts +1 -0
  337. package/src/custom_auth/core/utils/ArgumentValidator.ts +26 -0
  338. package/src/custom_auth/index.ts +10 -11
  339. package/src/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.ts +6 -7
  340. package/src/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.ts +28 -5
  341. package/src/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateTransitionHandlerV2.ts +30 -0
  342. package/src/custom_auth/sign_in/auth_flow/v2/result/SignInContinuationResultV2.ts +4 -8
  343. package/src/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.ts +4 -7
  344. package/src/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.ts +3 -6
  345. package/src/custom_auth/sign_in/auth_flow/v2/state/SignInStateParametersV2.ts +0 -3
  346. package/src/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.ts +2 -3
  347. package/src/custom_auth/sign_up/auth_flow/v2/result/ExistingAccountActionResultsV2.ts +49 -0
  348. package/src/custom_auth/sign_up/auth_flow/v2/result/SignUpStartResultV2.ts +8 -4
  349. package/src/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.ts +16 -4
  350. package/src/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.ts +26 -5
  351. package/src/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountCodeRequiredStateV2.ts +101 -0
  352. package/src/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountPasswordRequiredStateV2.ts +53 -0
  353. package/src/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountStateTransitionHelperV2.ts +97 -0
  354. package/src/custom_auth/sign_up/auth_flow/v2/state/SignUpStateParametersV2.ts +0 -6
  355. package/src/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.ts +25 -48
  356. package/src/interaction_client/PlatformAuthInteractionClient.ts +53 -38
  357. package/src/interaction_client/RedirectClient.ts +5 -1
  358. package/src/interaction_client/StandardInteractionClient.ts +4 -0
  359. package/src/packageMetadata.ts +1 -1
  360. package/types/custom_auth/CustomAuthActionInputs.d.ts +12 -5
  361. package/types/custom_auth/CustomAuthActionInputs.d.ts.map +1 -1
  362. package/types/custom_auth/CustomAuthConstants.d.ts +1 -1
  363. package/types/custom_auth/CustomAuthPublicClientApplication.d.ts +5 -3
  364. package/types/custom_auth/CustomAuthPublicClientApplication.d.ts.map +1 -1
  365. package/types/custom_auth/ICustomAuthPublicClientApplicationV2.d.ts +5 -3
  366. package/types/custom_auth/ICustomAuthPublicClientApplicationV2.d.ts.map +1 -1
  367. package/types/custom_auth/controller/CustomAuthStandardController.d.ts +2 -0
  368. package/types/custom_auth/controller/CustomAuthStandardController.d.ts.map +1 -1
  369. package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.d.ts +1 -2
  370. package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.d.ts.map +1 -1
  371. package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodV2.d.ts +1 -4
  372. package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodV2.d.ts.map +1 -1
  373. package/types/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.d.ts +5 -4
  374. package/types/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.d.ts.map +1 -1
  375. package/types/custom_auth/core/auth_flow/v2/CustomAuthResultV2.d.ts +17 -8
  376. package/types/custom_auth/core/auth_flow/v2/CustomAuthResultV2.d.ts.map +1 -1
  377. package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.d.ts +6 -0
  378. package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.d.ts.map +1 -1
  379. package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.d.ts +23 -44
  380. package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.d.ts.map +1 -1
  381. package/types/custom_auth/core/auth_flow/v2/result/AuthMethodRegistrationChallengeResultV2.d.ts +3 -3
  382. package/types/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.d.ts +7 -6
  383. package/types/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.d.ts.map +1 -1
  384. package/types/custom_auth/core/auth_flow/v2/result/MFASubmitChallengeResultV2.d.ts +7 -6
  385. package/types/custom_auth/core/auth_flow/v2/result/MFASubmitChallengeResultV2.d.ts.map +1 -1
  386. package/types/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.d.ts +8 -7
  387. package/types/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.d.ts.map +1 -1
  388. package/types/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.d.ts +4 -6
  389. package/types/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.d.ts.map +1 -1
  390. package/types/custom_auth/core/auth_flow/v2/result/SubmitPasswordResultV2.d.ts +20 -0
  391. package/types/custom_auth/core/auth_flow/v2/result/SubmitPasswordResultV2.d.ts.map +1 -0
  392. package/types/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.d.ts +6 -8
  393. package/types/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.d.ts.map +1 -1
  394. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.d.ts +2 -2
  395. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.d.ts +3 -6
  396. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.d.ts.map +1 -1
  397. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.d.ts +3 -3
  398. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.d.ts.map +1 -1
  399. package/types/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.d.ts +6 -8
  400. package/types/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.d.ts.map +1 -1
  401. package/types/custom_auth/core/auth_flow/v2/state/CompletedStateV2.d.ts +1 -3
  402. package/types/custom_auth/core/auth_flow/v2/state/CompletedStateV2.d.ts.map +1 -1
  403. package/types/custom_auth/core/auth_flow/v2/state/CustomAuthStateParametersV2.d.ts +9 -2
  404. package/types/custom_auth/core/auth_flow/v2/state/CustomAuthStateParametersV2.d.ts.map +1 -1
  405. package/types/custom_auth/core/auth_flow/v2/state/FailedStateV2.d.ts +1 -2
  406. package/types/custom_auth/core/auth_flow/v2/state/FailedStateV2.d.ts.map +1 -1
  407. package/types/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.d.ts +5 -6
  408. package/types/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.d.ts.map +1 -1
  409. package/types/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.d.ts +23 -0
  410. package/types/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.d.ts.map +1 -0
  411. package/types/custom_auth/core/error/InvalidArgumentError.d.ts +1 -0
  412. package/types/custom_auth/core/error/InvalidArgumentError.d.ts.map +1 -1
  413. package/types/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.d.ts +8 -1
  414. package/types/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.d.ts.map +1 -1
  415. package/types/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.d.ts +12 -10
  416. package/types/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.d.ts.map +1 -1
  417. package/types/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.d.ts +1 -1
  418. package/types/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.d.ts.map +1 -1
  419. package/types/custom_auth/core/interaction_client/v2/parameter/FlowParamsV2.d.ts +2 -5
  420. package/types/custom_auth/core/interaction_client/v2/parameter/FlowParamsV2.d.ts.map +1 -1
  421. package/types/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.d.ts +22 -3
  422. package/types/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.d.ts.map +1 -1
  423. package/types/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.d.ts.map +1 -1
  424. package/types/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.d.ts.map +1 -1
  425. package/types/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.d.ts +2 -1
  426. package/types/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.d.ts.map +1 -1
  427. package/types/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.d.ts +1 -1
  428. package/types/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.d.ts.map +1 -1
  429. package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorResponsesV2.d.ts.map +1 -1
  430. package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.d.ts +8 -8
  431. package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.d.ts.map +1 -1
  432. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.d.ts.map +1 -1
  433. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.d.ts +18 -6
  434. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.d.ts.map +1 -1
  435. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.d.ts +6 -10
  436. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.d.ts.map +1 -1
  437. package/types/custom_auth/core/telemetry/FlowApiIdHelperV2.d.ts +0 -4
  438. package/types/custom_auth/core/telemetry/FlowApiIdHelperV2.d.ts.map +1 -1
  439. package/types/custom_auth/core/telemetry/PublicApiId.d.ts +1 -0
  440. package/types/custom_auth/core/telemetry/PublicApiId.d.ts.map +1 -1
  441. package/types/custom_auth/core/utils/ArgumentValidator.d.ts +3 -0
  442. package/types/custom_auth/core/utils/ArgumentValidator.d.ts.map +1 -1
  443. package/types/custom_auth/index.d.ts +5 -5
  444. package/types/custom_auth/index.d.ts.map +1 -1
  445. package/types/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.d.ts +6 -8
  446. package/types/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.d.ts.map +1 -1
  447. package/types/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.d.ts +7 -5
  448. package/types/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.d.ts.map +1 -1
  449. package/types/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateTransitionHandlerV2.d.ts +7 -0
  450. package/types/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateTransitionHandlerV2.d.ts.map +1 -0
  451. package/types/custom_auth/sign_in/auth_flow/v2/result/SignInContinuationResultV2.d.ts +4 -8
  452. package/types/custom_auth/sign_in/auth_flow/v2/result/SignInContinuationResultV2.d.ts.map +1 -1
  453. package/types/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.d.ts +5 -6
  454. package/types/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.d.ts.map +1 -1
  455. package/types/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.d.ts +3 -6
  456. package/types/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.d.ts.map +1 -1
  457. package/types/custom_auth/sign_in/auth_flow/v2/state/SignInStateParametersV2.d.ts +0 -1
  458. package/types/custom_auth/sign_in/auth_flow/v2/state/SignInStateParametersV2.d.ts.map +1 -1
  459. package/types/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.d.ts +3 -2
  460. package/types/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.d.ts.map +1 -1
  461. package/types/custom_auth/sign_up/auth_flow/v2/result/ExistingAccountActionResultsV2.d.ts +27 -0
  462. package/types/custom_auth/sign_up/auth_flow/v2/result/ExistingAccountActionResultsV2.d.ts.map +1 -0
  463. package/types/custom_auth/sign_up/auth_flow/v2/result/SignUpStartResultV2.d.ts +6 -3
  464. package/types/custom_auth/sign_up/auth_flow/v2/result/SignUpStartResultV2.d.ts.map +1 -1
  465. package/types/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.d.ts +12 -3
  466. package/types/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.d.ts.map +1 -1
  467. package/types/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.d.ts +8 -3
  468. package/types/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.d.ts.map +1 -1
  469. package/types/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountCodeRequiredStateV2.d.ts +24 -0
  470. package/types/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountCodeRequiredStateV2.d.ts.map +1 -0
  471. package/types/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountPasswordRequiredStateV2.d.ts +18 -0
  472. package/types/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountPasswordRequiredStateV2.d.ts.map +1 -0
  473. package/types/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountStateTransitionHelperV2.d.ts +7 -0
  474. package/types/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountStateTransitionHelperV2.d.ts.map +1 -0
  475. package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpStateParametersV2.d.ts +0 -4
  476. package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpStateParametersV2.d.ts.map +1 -1
  477. package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.d.ts +5 -4
  478. package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.d.ts.map +1 -1
  479. package/types/interaction_client/PlatformAuthInteractionClient.d.ts +4 -3
  480. package/types/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
  481. package/types/interaction_client/RedirectClient.d.ts.map +1 -1
  482. package/types/interaction_client/StandardInteractionClient.d.ts.map +1 -1
  483. package/types/packageMetadata.d.ts +1 -1
  484. package/dist/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.mjs +0 -82
  485. package/dist/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.mjs.map +0 -1
  486. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.mjs +0 -25
  487. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.mjs.map +0 -1
  488. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.mjs +0 -45
  489. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.mjs.map +0 -1
  490. package/src/custom_auth/core/auth_flow/v2/result/MFAResendChallengeResultV2.ts +0 -23
  491. package/src/custom_auth/core/auth_flow/v2/result/ResendCodeResultV2.ts +0 -19
  492. package/src/custom_auth/sign_in/auth_flow/v2/result/SubmitPasswordResultV2.ts +0 -22
  493. package/src/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.ts +0 -115
  494. package/src/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.ts +0 -34
  495. package/src/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.ts +0 -61
  496. package/types/custom_auth/core/auth_flow/v2/result/MFAResendChallengeResultV2.d.ts +0 -14
  497. package/types/custom_auth/core/auth_flow/v2/result/MFAResendChallengeResultV2.d.ts.map +0 -1
  498. package/types/custom_auth/core/auth_flow/v2/result/ResendCodeResultV2.d.ts +0 -13
  499. package/types/custom_auth/core/auth_flow/v2/result/ResendCodeResultV2.d.ts.map +0 -1
  500. package/types/custom_auth/sign_in/auth_flow/v2/result/SubmitPasswordResultV2.d.ts +0 -9
  501. package/types/custom_auth/sign_in/auth_flow/v2/result/SubmitPasswordResultV2.d.ts.map +0 -1
  502. package/types/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.d.ts +0 -17
  503. package/types/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.d.ts.map +0 -1
  504. package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.d.ts +0 -11
  505. package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.d.ts.map +0 -1
  506. package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.d.ts +0 -19
  507. package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.d.ts.map +0 -1
@@ -4,7 +4,6 @@
4
4
  */
5
5
 
6
6
  import { CustomAuthResultV2 } from "../../../../core/auth_flow/v2/CustomAuthResultV2.js";
7
- import type { VerifyChallengeResultV2 } from "../../../../core/auth_flow/v2/result/VerifyChallengeResultV2.js";
8
7
  import type {
9
8
  CodeRequiredStateParametersV2,
10
9
  CustomAuthActionRequiredStateParametersV2,
@@ -15,7 +14,7 @@ import type {
15
14
  FlowPasswordRequiredResultV2,
16
15
  } from "../../../../core/interaction_client/v2/result/FlowActionResultV2.js";
17
16
  import { AuthenticationFactorV2 } from "../../../../core/network_client/custom_auth_api/v2/result/BaseResultsV2.js";
18
- import { PasswordRequiredStateV2 } from "./PasswordRequiredStateV2.js";
17
+ import { PasswordRequiredStateV2 } from "../../../../core/auth_flow/v2/state/PasswordRequiredStateV2.js";
19
18
  import type { RequestChallengeResultV2 } from "../../../../core/auth_flow/v2/result/RequestChallengeResultV2.js";
20
19
 
21
20
  export class SignInStateTransitionHandlerV2 {
@@ -37,7 +36,7 @@ export class SignInStateTransitionHandlerV2 {
37
36
  handleMfaRequired(
38
37
  result: FlowMFARequiredResultV2,
39
38
  stateParameters: CodeRequiredStateParametersV2
40
- ): VerifyChallengeResultV2 {
39
+ ): CustomAuthResultV2<AuthMethodSelectionRequiredStateV2, undefined> {
41
40
  return new CustomAuthResultV2(
42
41
  new AuthMethodSelectionRequiredStateV2({
43
42
  correlationId: result.correlationId,
@@ -0,0 +1,49 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import type { CustomAuthResultV2 } from "../../../../core/auth_flow/v2/CustomAuthResultV2.js";
7
+ import type { AuthMethodRegistrationRequiredStateV2 } from "../../../../core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.js";
8
+ import type { AuthMethodSelectionRequiredStateV2 } from "../../../../core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.js";
9
+ import type { CompletedStateV2 } from "../../../../core/auth_flow/v2/state/CompletedStateV2.js";
10
+ import type { FailedStateV2 } from "../../../../core/auth_flow/v2/state/FailedStateV2.js";
11
+ import type { CustomAuthAccountData } from "../../../../get_account/auth_flow/CustomAuthAccountData.js";
12
+
13
+ /**
14
+ * States returned after submitting an existing-account code during sign-up.
15
+ * Authentication can complete or require enrollment or MFA method selection.
16
+ */
17
+ export type ExistingAccountSubmitCodeResultStateV2 =
18
+ | AuthMethodSelectionRequiredStateV2
19
+ | AuthMethodRegistrationRequiredStateV2
20
+ | CompletedStateV2
21
+ | FailedStateV2;
22
+
23
+ /**
24
+ * Result of submitting an existing-account code during sign-up. Account data
25
+ * is present when authentication completes successfully.
26
+ */
27
+ export type ExistingAccountSubmitCodeResultV2 = CustomAuthResultV2<
28
+ ExistingAccountSubmitCodeResultStateV2,
29
+ CustomAuthAccountData | undefined
30
+ >;
31
+
32
+ /**
33
+ * States returned after submitting an existing-account password during sign-up.
34
+ * Authentication can complete or require enrollment or MFA method selection.
35
+ */
36
+ export type ExistingAccountSubmitPasswordResultStateV2 =
37
+ | AuthMethodSelectionRequiredStateV2
38
+ | AuthMethodRegistrationRequiredStateV2
39
+ | CompletedStateV2
40
+ | FailedStateV2;
41
+
42
+ /**
43
+ * Result of submitting an existing-account password during sign-up. Account
44
+ * data is present when authentication completes successfully.
45
+ */
46
+ export type ExistingAccountSubmitPasswordResultV2 = CustomAuthResultV2<
47
+ ExistingAccountSubmitPasswordResultStateV2,
48
+ CustomAuthAccountData | undefined
49
+ >;
@@ -6,19 +6,23 @@
6
6
  import { CustomAuthResultV2 } from "../../../../core/auth_flow/v2/CustomAuthResultV2.js";
7
7
  import type { CodeRequiredStateV2 } from "../../../../core/auth_flow/v2/state/CodeRequiredStateV2.js";
8
8
  import type { FailedStateV2 } from "../../../../core/auth_flow/v2/state/FailedStateV2.js";
9
- import type { AttributesRequiredStateV2 } from "../state/AttributesRequiredStateV2.js";
10
- import type { SignUpPasswordRequiredStateV2 } from "../state/SignUpPasswordRequiredStateV2.js";
9
+ import type { ExistingAccountCodeRequiredStateV2 } from "../state/ExistingAccountCodeRequiredStateV2.js";
10
+ import type { ExistingAccountPasswordRequiredStateV2 } from "../state/ExistingAccountPasswordRequiredStateV2.js";
11
+ import type { AuthMethodSelectionRequiredStateV2 } from "../../../../core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.js";
11
12
 
12
13
  /**
13
14
  * States returned when native auth V2 sign-up starts.
15
+ * @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
14
16
  */
15
17
  export type SignUpStartResultStateV2 =
16
18
  | CodeRequiredStateV2
17
- | SignUpPasswordRequiredStateV2
18
- | AttributesRequiredStateV2
19
+ | ExistingAccountCodeRequiredStateV2
20
+ | ExistingAccountPasswordRequiredStateV2
21
+ | AuthMethodSelectionRequiredStateV2
19
22
  | FailedStateV2;
20
23
 
21
24
  /**
22
25
  * Result of starting native auth V2 sign-up.
26
+ * @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
23
27
  */
24
28
  export type SignUpStartResultV2 = CustomAuthResultV2<SignUpStartResultStateV2>;
@@ -5,15 +5,27 @@
5
5
 
6
6
  import { CustomAuthResultV2 } from "../../../../core/auth_flow/v2/CustomAuthResultV2.js";
7
7
  import type { AuthMethodRegistrationRequiredStateV2 } from "../../../../core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.js";
8
- import type { CodeRequiredStateV2 } from "../../../../core/auth_flow/v2/state/CodeRequiredStateV2.js";
8
+ import type { PasswordRequiredStateV2 } from "../../../../core/auth_flow/v2/state/PasswordRequiredStateV2.js";
9
9
  import type { FailedStateV2 } from "../../../../core/auth_flow/v2/state/FailedStateV2.js";
10
10
  import type { SignInContinuationStateV2 } from "../../../../sign_in/auth_flow/v2/state/SignInContinuationStateV2.js";
11
+ import type { AttributesRequiredStateV2 } from "../state/AttributesRequiredStateV2.js";
11
12
 
13
+ /**
14
+ * States returned after submitting sign-up attributes.
15
+ * @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
16
+ */
12
17
  export type SubmitAttributesResultStateV2 =
13
- | CodeRequiredStateV2
18
+ | AttributesRequiredStateV2
19
+ | PasswordRequiredStateV2
14
20
  | SignInContinuationStateV2
15
21
  | AuthMethodRegistrationRequiredStateV2
16
22
  | FailedStateV2;
17
23
 
18
- export type SubmitAttributesResultV2 =
19
- CustomAuthResultV2<SubmitAttributesResultStateV2>;
24
+ /**
25
+ * Result of submitting sign-up attributes.
26
+ * @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
27
+ */
28
+ export type SubmitAttributesResultV2 = CustomAuthResultV2<
29
+ SubmitAttributesResultStateV2,
30
+ undefined
31
+ >;
@@ -6,26 +6,47 @@
6
6
  import type { UserAccountAttributes } from "../../../../UserAccountAttributes.js";
7
7
  import { CustomAuthResultV2 } from "../../../../core/auth_flow/v2/CustomAuthResultV2.js";
8
8
  import type { SubmitAttributesResultV2 } from "../result/SubmitAttributesResultV2.js";
9
- import { SignUpAttributesRequiredStateBaseV2 } from "./SignUpAttributesRequiredStateBaseV2.js";
9
+ import { AuthFlowActionRequiredStateBase } from "../../../../core/auth_flow/AuthFlowState.js";
10
+ import type { SignUpAttributeV2 } from "../../../../core/network_client/custom_auth_api/v2/result/SignUpResultsV2.js";
10
11
  import type { AttributesRequiredStateParametersV2 } from "./SignUpStateParametersV2.js";
12
+ import * as ArgumentValidator from "../../../../core/utils/ArgumentValidator.js";
11
13
 
12
14
  /**
13
15
  * State returned when sign-up requires profile or custom attributes.
16
+ * @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
14
17
  */
15
- export class AttributesRequiredStateV2 extends SignUpAttributesRequiredStateBaseV2<AttributesRequiredStateParametersV2> {
18
+ export class AttributesRequiredStateV2 extends AuthFlowActionRequiredStateBase<AttributesRequiredStateParametersV2> {
16
19
  readonly stateType = "attributesRequired";
17
20
 
21
+ readonly attributes: readonly SignUpAttributeV2[];
22
+
23
+ constructor(stateParameters: AttributesRequiredStateParametersV2) {
24
+ super(stateParameters);
25
+ this.attributes = stateParameters.attributes;
26
+ }
27
+
18
28
  /**
19
- * Submits the attributes requested by the latest server response.
29
+ * Submits the supplied attributes, including an empty object, to the service.
30
+ * The returned result identifies the next step or a submission failure.
20
31
  */
21
32
  async submitAttributes(
22
33
  attributes: UserAccountAttributes
23
34
  ): Promise<SubmitAttributesResultV2> {
24
- const { correlationId, logger, continuationState } =
35
+ const { correlationId, logger, continuationState, flowClient } =
25
36
  this.stateParameters;
26
37
 
27
38
  try {
28
- const result = await this.submitAttributesAction(attributes);
39
+ const filteredAttributes =
40
+ ArgumentValidator.filterReservedSignUpAttributesV2(
41
+ attributes,
42
+ logger,
43
+ correlationId
44
+ );
45
+ const result = await flowClient.submitSignUpAttributes({
46
+ correlationId,
47
+ continuationState,
48
+ attributes: filteredAttributes,
49
+ });
29
50
  return this.stateParameters.signUpStateTransitionHandler.handleAttributeSubmission(
30
51
  result,
31
52
  this.stateParameters,
@@ -0,0 +1,101 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { ChallengeVerificationStateBaseV2 } from "../../../../core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.js";
7
+ import { CustomAuthResultV2 } from "../../../../core/auth_flow/v2/CustomAuthResultV2.js";
8
+ import { CustomAuthError } from "../../../../core/error/CustomAuthError.js";
9
+ import { UNSUPPORTED_FLOW_TRANSITION } from "../../../../core/network_client/custom_auth_api/v2/ErrorCodesV2.js";
10
+ import {
11
+ FLOW_AUTH_METHOD_REGISTRATION_REQUIRED_V2,
12
+ FLOW_COMPLETED_V2,
13
+ FLOW_MFA_REQUIRED_V2,
14
+ } from "../../../../core/interaction_client/v2/result/FlowActionResultV2.js";
15
+ import type { RequestChallengeResultV2 } from "../../../../core/auth_flow/v2/result/RequestChallengeResultV2.js";
16
+ import type { ExistingAccountSubmitCodeResultV2 } from "../result/ExistingAccountActionResultsV2.js";
17
+ import { handleExistingAccountVerificationResultV2 } from "./ExistingAccountStateTransitionHelperV2.js";
18
+
19
+ /**
20
+ * State returned when sign-up discovers an existing account that requires an
21
+ * email code. Submitting or resending the code preserves existing-account authentication.
22
+ */
23
+ export class ExistingAccountCodeRequiredStateV2 extends ChallengeVerificationStateBaseV2 {
24
+ readonly stateType = "existingAccountCodeRequired";
25
+
26
+ /**
27
+ * Submits the existing account's email code and continues authentication.
28
+ * The result can complete authentication or require enrollment or MFA.
29
+ * @param code - The email code to verify.
30
+ * @returns The next existing-account authentication result.
31
+ */
32
+ async submitCode(code: string): Promise<ExistingAccountSubmitCodeResultV2> {
33
+ const { correlationId, logger, continuationState } =
34
+ this.stateParameters;
35
+
36
+ try {
37
+ const result = await this.submitCodeCore(code);
38
+ if (
39
+ result.type === FLOW_COMPLETED_V2 ||
40
+ result.type === FLOW_AUTH_METHOD_REGISTRATION_REQUIRED_V2 ||
41
+ result.type === FLOW_MFA_REQUIRED_V2
42
+ ) {
43
+ return handleExistingAccountVerificationResultV2(
44
+ result,
45
+ this.stateParameters
46
+ );
47
+ }
48
+
49
+ const resultType: string = result.type;
50
+ throw new CustomAuthError(
51
+ UNSUPPORTED_FLOW_TRANSITION,
52
+ `Existing-account code submission result type '${resultType}' is not supported.`,
53
+ correlationId
54
+ );
55
+ } catch (error) {
56
+ logger.errorPii(
57
+ `Failed to submit V2 existing-account code. Error: '${error}'.`,
58
+ correlationId
59
+ );
60
+ return CustomAuthResultV2.createWithError(error, {
61
+ scenario: continuationState.scenario,
62
+ correlationId,
63
+ });
64
+ }
65
+ }
66
+
67
+ /**
68
+ * Requests a replacement email code for the existing account. The returned
69
+ * state contains the fresh continuation token and challenge metadata.
70
+ * @returns The refreshed existing-account code state or an error.
71
+ */
72
+ async resendCode(): Promise<RequestChallengeResultV2> {
73
+ const { correlationId, logger, continuationState } =
74
+ this.stateParameters;
75
+
76
+ try {
77
+ const result = await this.resendCodeCore();
78
+ return new CustomAuthResultV2(
79
+ new ExistingAccountCodeRequiredStateV2({
80
+ ...this.stateParameters,
81
+ correlationId: result.correlationId,
82
+ continuationState: result.continuationState,
83
+ sentTo: result.sentTo,
84
+ channel: result.channel,
85
+ codeLength: result.codeLength,
86
+ }),
87
+ undefined,
88
+ result.continuationState.scenario
89
+ );
90
+ } catch (error) {
91
+ logger.errorPii(
92
+ `Failed to resend V2 existing-account code. Error: '${error}'.`,
93
+ correlationId
94
+ );
95
+ return CustomAuthResultV2.createWithError(error, {
96
+ scenario: continuationState.scenario,
97
+ correlationId,
98
+ });
99
+ }
100
+ }
101
+ }
@@ -0,0 +1,53 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { AuthFlowActionRequiredStateBase } from "../../../../core/auth_flow/AuthFlowState.js";
7
+ import type { CustomAuthActionRequiredStateParametersV2 } from "../../../../core/auth_flow/v2/state/CustomAuthStateParametersV2.js";
8
+ import { CustomAuthResultV2 } from "../../../../core/auth_flow/v2/CustomAuthResultV2.js";
9
+ import type { ExistingAccountSubmitPasswordResultV2 } from "../result/ExistingAccountActionResultsV2.js";
10
+ import { handleExistingAccountVerificationResultV2 } from "./ExistingAccountStateTransitionHelperV2.js";
11
+
12
+ /**
13
+ * State returned when sign-up discovers an existing account that requires its
14
+ * current password. The password is verified as an authentication credential.
15
+ */
16
+ export class ExistingAccountPasswordRequiredStateV2 extends AuthFlowActionRequiredStateBase<CustomAuthActionRequiredStateParametersV2> {
17
+ readonly stateType = "existingAccountPasswordRequired";
18
+
19
+ /**
20
+ * Verifies the existing account's current password and continues authentication.
21
+ * The result can complete authentication or require enrollment or MFA.
22
+ * @param password - The existing account password.
23
+ * @returns The next existing-account authentication result.
24
+ */
25
+ async submitPassword(
26
+ password: string
27
+ ): Promise<ExistingAccountSubmitPasswordResultV2> {
28
+ const { correlationId, logger, continuationState, flowClient } =
29
+ this.stateParameters;
30
+
31
+ try {
32
+ this.ensurePasswordIsNotEmpty(password);
33
+ const result = await flowClient.submitSignInPassword({
34
+ correlationId,
35
+ continuationState,
36
+ password,
37
+ });
38
+ return handleExistingAccountVerificationResultV2(
39
+ result,
40
+ this.stateParameters
41
+ );
42
+ } catch (error) {
43
+ logger.errorPii(
44
+ `Failed to submit V2 existing-account password. Error: '${error}'.`,
45
+ correlationId
46
+ );
47
+ return CustomAuthResultV2.createWithError(error, {
48
+ scenario: continuationState.scenario,
49
+ correlationId,
50
+ });
51
+ }
52
+ }
53
+ }
@@ -0,0 +1,97 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { CustomAuthAccountData } from "../../../../get_account/auth_flow/CustomAuthAccountData.js";
7
+ import { CustomAuthError } from "../../../../core/error/CustomAuthError.js";
8
+ import { UNSUPPORTED_FLOW_TRANSITION } from "../../../../core/network_client/custom_auth_api/v2/ErrorCodesV2.js";
9
+ import {
10
+ FLOW_AUTH_METHOD_REGISTRATION_REQUIRED_V2,
11
+ FLOW_COMPLETED_V2,
12
+ FLOW_MFA_REQUIRED_V2,
13
+ type FlowAuthMethodRegistrationRequiredResultV2,
14
+ type FlowCompletedResultV2,
15
+ type FlowMFARequiredResultV2,
16
+ } from "../../../../core/interaction_client/v2/result/FlowActionResultV2.js";
17
+ import { CustomAuthResultV2 } from "../../../../core/auth_flow/v2/CustomAuthResultV2.js";
18
+ import { AuthMethodRegistrationRequiredStateV2 } from "../../../../core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.js";
19
+ import { CompletedStateV2 } from "../../../../core/auth_flow/v2/state/CompletedStateV2.js";
20
+ import type { CustomAuthActionRequiredStateParametersV2 } from "../../../../core/auth_flow/v2/state/CustomAuthStateParametersV2.js";
21
+ import type {
22
+ ExistingAccountSubmitCodeResultV2,
23
+ ExistingAccountSubmitPasswordResultV2,
24
+ } from "../result/ExistingAccountActionResultsV2.js";
25
+
26
+ type ExistingAccountVerificationResultV2 =
27
+ | FlowMFARequiredResultV2
28
+ | FlowAuthMethodRegistrationRequiredResultV2
29
+ | FlowCompletedResultV2;
30
+
31
+ export function handleExistingAccountVerificationResultV2(
32
+ result: ExistingAccountVerificationResultV2,
33
+ stateParameters: CustomAuthActionRequiredStateParametersV2
34
+ ): ExistingAccountSubmitCodeResultV2 | ExistingAccountSubmitPasswordResultV2 {
35
+ const commonStateParameters = {
36
+ correlationId: result.correlationId,
37
+ logger: stateParameters.logger,
38
+ config: stateParameters.config,
39
+ flowClient: stateParameters.flowClient,
40
+ continuationState:
41
+ "continuationState" in result
42
+ ? result.continuationState
43
+ : stateParameters.continuationState,
44
+ cacheClient: stateParameters.cacheClient,
45
+ };
46
+
47
+ if (result.type === FLOW_COMPLETED_V2) {
48
+ const account = new CustomAuthAccountData(
49
+ result.authenticationResult.account,
50
+ stateParameters.config,
51
+ stateParameters.cacheClient,
52
+ stateParameters.logger,
53
+ result.correlationId
54
+ );
55
+ return new CustomAuthResultV2(
56
+ new CompletedStateV2(),
57
+ account,
58
+ stateParameters.continuationState.scenario
59
+ );
60
+ }
61
+
62
+ if (result.type === FLOW_AUTH_METHOD_REGISTRATION_REQUIRED_V2) {
63
+ return new CustomAuthResultV2(
64
+ new AuthMethodRegistrationRequiredStateV2({
65
+ ...commonStateParameters,
66
+ continuationState: result.continuationState,
67
+ methods: result.methods,
68
+ }),
69
+ undefined,
70
+ result.continuationState.scenario
71
+ );
72
+ }
73
+
74
+ if (result.type === FLOW_MFA_REQUIRED_V2) {
75
+ const signInStateTransitionHandler =
76
+ stateParameters.signInStateTransitionHandler;
77
+ if (!signInStateTransitionHandler) {
78
+ throw new CustomAuthError(
79
+ UNSUPPORTED_FLOW_TRANSITION,
80
+ "Sign-in state transition handler is missing.",
81
+ stateParameters.correlationId
82
+ );
83
+ }
84
+
85
+ return signInStateTransitionHandler.handleMfaRequired(
86
+ result,
87
+ stateParameters
88
+ );
89
+ }
90
+
91
+ const resultType = (result as { type: string }).type;
92
+ throw new CustomAuthError(
93
+ UNSUPPORTED_FLOW_TRANSITION,
94
+ `Existing-account verification result type '${resultType}' is not supported.`,
95
+ stateParameters.correlationId
96
+ );
97
+ }
@@ -16,9 +16,3 @@ export interface AttributesRequiredStateParametersV2
16
16
  extends SignUpActionRequiredStateParametersV2 {
17
17
  attributes: SignUpAttributeV2[];
18
18
  }
19
-
20
- export interface SignUpPasswordRequiredStateParametersV2
21
- extends SignUpActionRequiredStateParametersV2 {
22
- attributes: SignUpAttributeV2[];
23
- requiredPasswordAttribute: SignUpAttributeV2;
24
- }
@@ -5,43 +5,53 @@
5
5
 
6
6
  import { CustomAuthResultV2 } from "../../../../core/auth_flow/v2/CustomAuthResultV2.js";
7
7
  import { AuthMethodRegistrationRequiredStateV2 } from "../../../../core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.js";
8
- import { CodeRequiredStateV2 } from "../../../../core/auth_flow/v2/state/CodeRequiredStateV2.js";
9
8
  import { CustomAuthError } from "../../../../core/error/CustomAuthError.js";
10
9
  import {
11
10
  FLOW_ATTRIBUTES_REQUIRED_V2,
12
11
  FLOW_AUTH_METHOD_REGISTRATION_REQUIRED_V2,
13
- FLOW_CODE_REQUIRED_V2,
12
+ FLOW_SIGN_UP_PASSWORD_REQUIRED_V2,
14
13
  FLOW_SIGN_IN_CONTINUATION_REQUIRED_V2,
15
- type FlowAttributesRequiredResultV2,
16
- type FlowSignUpActionResultV2,
17
- type FlowSignUpPasswordRequiredResultV2,
14
+ type FlowSignUpSubmitAttributesResultV2,
18
15
  } from "../../../../core/interaction_client/v2/result/FlowActionResultV2.js";
19
16
  import { UNSUPPORTED_FLOW_TRANSITION } from "../../../../core/network_client/custom_auth_api/v2/ErrorCodesV2.js";
20
17
  import { SignInContinuationStateV2 } from "../../../../sign_in/auth_flow/v2/state/SignInContinuationStateV2.js";
21
- import type { VerifyChallengeResultV2 } from "../../../../core/auth_flow/v2/result/VerifyChallengeResultV2.js";
22
18
  import type { SubmitAttributesResultV2 } from "../result/SubmitAttributesResultV2.js";
23
19
  import { AttributesRequiredStateV2 } from "./AttributesRequiredStateV2.js";
24
- import { SignUpPasswordRequiredStateV2 } from "./SignUpPasswordRequiredStateV2.js";
20
+ import { PasswordRequiredStateV2 } from "../../../../core/auth_flow/v2/state/PasswordRequiredStateV2.js";
25
21
  import type { SignUpActionRequiredStateParametersV2 } from "./SignUpStateParametersV2.js";
26
22
 
27
23
  export class SignUpStateTransitionHandlerV2 {
24
+ /**
25
+ * Maps new-account verification and attribute-submission outcomes to public states.
26
+ */
28
27
  handleAttributeSubmission(
29
- result: FlowSignUpActionResultV2,
28
+ result: FlowSignUpSubmitAttributesResultV2,
30
29
  stateParameters: SignUpActionRequiredStateParametersV2,
31
30
  submission: "attribute" | "password"
32
31
  ): SubmitAttributesResultV2 {
32
+ const resultType: string = result.type;
33
33
  const commonStateParameters = this.createCommonStateParameters(
34
34
  result,
35
35
  stateParameters
36
36
  );
37
37
 
38
- if (result.type === FLOW_CODE_REQUIRED_V2) {
38
+ if (result.type === FLOW_SIGN_UP_PASSWORD_REQUIRED_V2) {
39
39
  return new CustomAuthResultV2(
40
- new CodeRequiredStateV2({
40
+ new PasswordRequiredStateV2({
41
41
  ...commonStateParameters,
42
- sentTo: result.sentTo,
43
- channel: result.channel,
44
- codeLength: result.codeLength,
42
+ requestedPasswordAttribute:
43
+ result.requestedPasswordAttribute,
44
+ }),
45
+ undefined,
46
+ result.continuationState.scenario
47
+ );
48
+ }
49
+
50
+ if (result.type === FLOW_ATTRIBUTES_REQUIRED_V2) {
51
+ return new CustomAuthResultV2(
52
+ new AttributesRequiredStateV2({
53
+ ...commonStateParameters,
54
+ attributes: result.attributes,
45
55
  }),
46
56
  undefined,
47
57
  result.continuationState.scenario
@@ -69,46 +79,13 @@ export class SignUpStateTransitionHandlerV2 {
69
79
 
70
80
  throw new CustomAuthError(
71
81
  UNSUPPORTED_FLOW_TRANSITION,
72
- `Sign-up ${submission} submission result type '${result.type}' is not supported.`,
82
+ `Sign-up ${submission} submission result type '${resultType}' is not supported.`,
73
83
  stateParameters.correlationId
74
84
  );
75
85
  }
76
86
 
77
- handleVerification(
78
- result:
79
- | FlowAttributesRequiredResultV2
80
- | FlowSignUpPasswordRequiredResultV2,
81
- stateParameters: SignUpActionRequiredStateParametersV2
82
- ): VerifyChallengeResultV2 {
83
- const commonStateParameters = this.createCommonStateParameters(
84
- result,
85
- stateParameters
86
- );
87
-
88
- if (result.type === FLOW_ATTRIBUTES_REQUIRED_V2) {
89
- return new CustomAuthResultV2(
90
- new AttributesRequiredStateV2({
91
- ...commonStateParameters,
92
- attributes: result.attributes,
93
- }),
94
- undefined,
95
- result.continuationState.scenario
96
- );
97
- }
98
-
99
- return new CustomAuthResultV2(
100
- new SignUpPasswordRequiredStateV2({
101
- ...commonStateParameters,
102
- attributes: result.attributes,
103
- requiredPasswordAttribute: result.requiredPasswordAttribute,
104
- }),
105
- undefined,
106
- result.continuationState.scenario
107
- );
108
- }
109
-
110
87
  private createCommonStateParameters(
111
- result: FlowSignUpActionResultV2,
88
+ result: FlowSignUpSubmitAttributesResultV2,
112
89
  stateParameters: SignUpActionRequiredStateParametersV2
113
90
  ): SignUpActionRequiredStateParametersV2 {
114
91
  return {