@azure/msal-browser
Version:
Microsoft Authentication Library for js
37 lines • 2.09 kB
TypeScript
import { Logger } from "@azure/msal-common/browser";
export declare const POPUP_POLL_INTERVAL_MS = 30;
/**
* Cancels legacy popup polling when an interaction is superseded.
*
* @internal
* @param logger Logger for the interaction.
*/
export declare function cancelPendingPopupPollingResponse(logger: Logger): void;
/**
* Monitors a popup window for a URL change to the same origin as the parent application.
* Polls the popup at a specified interval until it is redirected back to the application,
* closed by the user, or a navigation to a same-origin URL is detected. Once a same-origin
* URL is detected, extracts the response string (query or hash) and resolves the promise.
*
* @param popupWindow - The popup window to monitor for navigation.
* @param popupWindowParent - The parent window that opened the popup.
* @param responseMode - Response mode (`"query"` | `"fragment"`) determines whether
* to read `location.search` or `location.hash` from the popup once on the same
* origin. Any value other than `"query"` is treated as fragment.
* @param logger - Logger instance.
* @param unloadWindow - Event handler to remove from the parent window on cleanup.
* @param correlationId
*/
export declare function monitorPopupForHash(popupWindow: Window, popupWindowParent: Window, responseMode: string, logger: Logger, unloadWindow: (e: Event) => void, correlationId: string): Promise<string>;
/**
* Performs cleanup operations after popup authentication.
* Strips auth-response params (code/state) from the popup URL while it is still
* open, closes the popup window, and removes the 'beforeunload' event listener
* from the parent window.
*
* @param popupWindow - The popup window to be closed.
* @param popupWindowParent - The parent window from which the event listener will be removed.
* @param unloadWindow - The event handler function to remove.
*/
export declare function cleanPopup(popupWindow: Window, popupWindowParent: Window, unloadWindow: (e: Event) => void): void;
//# sourceMappingURL=PopupMonitor.d.ts.map