@azure/msal-browser
Version:
Microsoft Authentication Library for js
48 lines (45 loc) • 2.08 kB
JavaScript
/*! @azure/msal-browser v5.30.0 2026-11-18 */
;
import { CustomAuthResultV2 } from '../../../../core/auth_flow/v2/CustomAuthResultV2.mjs';
import { AuthFlowActionRequiredStateBase } from '../../../../core/auth_flow/AuthFlowState.mjs';
import { filterReservedSignUpAttributesV2 } from '../../../../core/utils/ArgumentValidator.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* State returned when sign-up requires profile or custom attributes.
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
*/
class AttributesRequiredStateV2 extends AuthFlowActionRequiredStateBase {
constructor(stateParameters) {
super(stateParameters);
this.stateType = "attributesRequired";
this.attributes = stateParameters.attributes;
}
/**
* Submits the supplied attributes, including an empty object, to the service.
* The returned result identifies the next step or a submission failure.
*/
async submitAttributes(attributes) {
const { correlationId, logger, continuationState, flowClient } = this.stateParameters;
try {
const filteredAttributes = filterReservedSignUpAttributesV2(attributes, logger, correlationId);
const result = await flowClient.submitSignUpAttributes({
correlationId,
continuationState,
attributes: filteredAttributes,
});
return this.stateParameters.signUpStateTransitionHandler.handleAttributeSubmission(result, this.stateParameters, "attribute");
}
catch (error) {
logger.errorPii(`0l4w01 ${error}`, correlationId);
return CustomAuthResultV2.createWithError(error, {
scenario: continuationState.scenario,
correlationId,
});
}
}
}
export { AttributesRequiredStateV2 };
//# sourceMappingURL=AttributesRequiredStateV2.mjs.map