25 lines
855 B
JavaScript
Executable file
25 lines
855 B
JavaScript
Executable file
/*! @azure/msal-react v3.0.17 2025-08-05 */
|
|
'use strict';
|
|
import React__default from 'react';
|
|
import { useMsal } from '../hooks/useMsal.js';
|
|
|
|
/*
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the MIT License.
|
|
*/
|
|
/**
|
|
* Higher order component wraps provided component with msal by injecting msal context values into the component's props
|
|
* @param Component
|
|
*/
|
|
const withMsal = (Component) => {
|
|
const ComponentWithMsal = (props) => {
|
|
const msal = useMsal();
|
|
return React__default.createElement(Component, { ...props, msalContext: msal });
|
|
};
|
|
const componentName = Component.displayName || Component.name || "Component";
|
|
ComponentWithMsal.displayName = `withMsal(${componentName})`;
|
|
return ComponentWithMsal;
|
|
};
|
|
|
|
export { withMsal };
|
|
//# sourceMappingURL=withMsal.js.map
|