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

14 lines (13 loc) 629 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var react_1 = require("react"); var AuthContext_1 = __importDefault(require("./AuthContext")); function UnauthenticatedTemplate(_a) { var children = _a.children; var authContext = (0, react_1.useContext)(AuthContext_1.default); return (authContext === null || authContext === void 0 ? void 0 : authContext.authManager.isAuthenticated()) ? null : children; } exports.default = UnauthenticatedTemplate;