@azure/msal-browser
Version:
Microsoft Authentication Library for js
40 lines (37 loc) • 1.76 kB
JavaScript
/*! @azure/msal-browser v5.30.0 2026-11-18 */
;
import { createBrowserAuthError } from '../error/BrowserAuthError.mjs';
import { popupRelayUnsupportedFlow } from '../error/BrowserAuthErrorCodes.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* postMessage envelope type used to relay an auth response from a popup-relay
* page (see `runPopupRelay`) back to the embedded frame that opened it. See
* {@link BrowserAuthOptions.popupRelayUri}.
*
* Shared by the relay-page entry and client helpers without importing either
* implementation into the other bundle.
*
* @internal
*/
const POPUP_RELAY_RESPONSE_TYPE = "msal:popup-relay-response:v1";
/** @internal Response bound to an authenticated v2 relay document. */
const POPUP_RELAY_V2_RESPONSE_TYPE = "msal:popup-relay-response:v2";
/** @internal Ready signal for the authenticated popup-relay request handoff. */
const POPUP_RELAY_READY_TYPE = "msal:popup-relay-ready:v2";
/** @internal Request delivered only to the same-origin relay window. */
const POPUP_RELAY_REQUEST_TYPE = "msal:popup-relay-request:v2";
/** @internal Resolve the compatibility default without downgrading invalid versions. */
function getPopupRelayProtocolVersion(version, correlationId = "") {
if (version === undefined) {
return 1;
}
if (version !== 1 && version !== 2) {
throw createBrowserAuthError(popupRelayUnsupportedFlow, correlationId, "popup_relay_invalid_protocol");
}
return version;
}
export { POPUP_RELAY_READY_TYPE, POPUP_RELAY_REQUEST_TYPE, POPUP_RELAY_RESPONSE_TYPE, POPUP_RELAY_V2_RESPONSE_TYPE, getPopupRelayProtocolVersion };
//# sourceMappingURL=constants.mjs.map