UNPKG

whodis-react

Version:

React hooks and components for secure, best practices authentication in seconds

20 lines 1.07 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.AuthenticationProvider = void 0; const react_1 = __importDefault(require("react")); const useAuthableTokenClaims_1 = require("../claims/useAuthableTokenClaims"); const AuthenticationContext_1 = require("./AuthenticationContext"); /** * a provider component which adds and manages the whodis AuthenticationContext */ const AuthenticationProvider = ({ children, storage, directoryUuid, clientUuid, override, }) => { // grab the claims const { claims } = (0, useAuthableTokenClaims_1.useAuthableTokenClaims)({ storage }); // pass them to the provider return (react_1.default.createElement(AuthenticationContext_1.AuthenticationContext.Provider, { value: { claims, directoryUuid, clientUuid, override } }, children)); }; exports.AuthenticationProvider = AuthenticationProvider; //# sourceMappingURL=AuthenticationProvider.js.map