UNPKG

whodis-react

Version:

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

21 lines 929 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.useAuthenticationConfig = void 0; const react_1 = require("react"); const AuthenticationContext_1 = require("./AuthenticationContext"); /** * internal use only * * exposes the directory and client uuid from context */ const useAuthenticationConfig = () => { // grab the data from the context const context = (0, react_1.useContext)(AuthenticationContext_1.AuthenticationContext); if (!context) throw new Error('AuthenticationContext was not initialized. Was the AuthenticationProvider used?'); // fail fast, to help in dev - since this is an issue that would only arise in dev const { directoryUuid, clientUuid, override } = context; // expose it return { directoryUuid, clientUuid, override }; }; exports.useAuthenticationConfig = useAuthenticationConfig; //# sourceMappingURL=useAuthenticationConfig.js.map