@azure/msal-browser
Version:
Microsoft Authentication Library for js
61 lines (58 loc) • 2.19 kB
JavaScript
/*! @azure/msal-browser v5.7.0 2026-04-16 */
;
import { AuthFlowResultBase } from '../../../core/auth_flow/AuthFlowResultBase.mjs';
import { SignUpSubmitCodeError } from '../error_type/SignUpError.mjs';
import { SignUpFailedState } from '../state/SignUpFailedState.mjs';
import { SIGN_UP_FAILED_STATE_TYPE, SIGN_UP_PASSWORD_REQUIRED_STATE_TYPE, SIGN_UP_ATTRIBUTES_REQUIRED_STATE_TYPE, SIGN_UP_COMPLETED_STATE_TYPE } from '../../../core/auth_flow/AuthFlowStateTypes.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/*
* Result of a sign-up operation that requires a code.
*/
class SignUpSubmitCodeResult extends AuthFlowResultBase {
/**
* Creates a new instance of SignUpSubmitCodeResult.
* @param state The state of the result.
*/
constructor(state) {
super(state);
}
/**
* Creates a new instance of SignUpSubmitCodeResult with an error.
* @param error The error that occurred.
* @returns {SignUpSubmitCodeResult} A new instance of SignUpSubmitCodeResult with the error set.
*/
static createWithError(error) {
const result = new SignUpSubmitCodeResult(new SignUpFailedState());
result.error = new SignUpSubmitCodeError(SignUpSubmitCodeResult.createErrorData(error));
return result;
}
/**
* Checks if the result is in a failed state.
*/
isFailed() {
return this.state.stateType === SIGN_UP_FAILED_STATE_TYPE;
}
/**
* Checks if the result is in a password required state.
*/
isPasswordRequired() {
return this.state.stateType === SIGN_UP_PASSWORD_REQUIRED_STATE_TYPE;
}
/**
* Checks if the result is in an attributes required state.
*/
isAttributesRequired() {
return this.state.stateType === SIGN_UP_ATTRIBUTES_REQUIRED_STATE_TYPE;
}
/**
* Checks if the result is in a completed state.
*/
isCompleted() {
return this.state.stateType === SIGN_UP_COMPLETED_STATE_TYPE;
}
}
export { SignUpSubmitCodeResult };
//# sourceMappingURL=SignUpSubmitCodeResult.mjs.map