UNPKG

@shane32/msoauth

Version:

A React library for Azure AD authentication with PKCE (Proof Key for Code Exchange) flow support. This library provides a secure and easy-to-use solution for implementing Azure AD authentication in React applications, with support for both API and Microso

9 lines (8 loc) 365 B
import { useContext } from "react"; import AuthContext from "./AuthContext"; function AuthenticatedTemplate(_a) { var children = _a.children; var authContext = useContext(AuthContext); return (authContext === null || authContext === void 0 ? void 0 : authContext.authManager.isAuthenticated()) ? children : null; } export default AuthenticatedTemplate;