UNPKG

bento-auth-js

Version:

Authentication library for web applications of Bento-Platform

19 lines 1 kB
import { jsx as _jsx } from "react/jsx-runtime"; import { createContext, useContext } from "react"; export const DEFAULT_AUTH_SCOPE = "openid email"; const defaultContextObject = { applicationUrl: "", // default must be false-y for 'missing context' error detection openIdConfigUrl: "", // default must be false-y for 'missing context' error detection clientId: "", // default must be false-y for 'missing context' error detection scope: DEFAULT_AUTH_SCOPE, postSignOutUrl: "", // default must be false-y for 'missing context' error detection authCallbackUrl: "", // default must be false-y for 'missing context' error detection }; export const BentoAuthContext = createContext(defaultContextObject); export const BentoAuthContextProvider = ({ children, value }) => { return _jsx(BentoAuthContext.Provider, { value: value, children: children }); }; export const useBentoAuthContext = () => { return useContext(BentoAuthContext); }; //# sourceMappingURL=contexts.js.map