react-auth-kit
Advanced tools
Comparing version 3.0.2-alpha.4 to 3.0.2-alpha.8
import type { Context } from 'react'; | ||
import TokenObject from './RxTokenObject'; | ||
export declare const AuthKitContext: Context<TokenObject<unknown>>; | ||
export declare function useReactAuthKitContext(): TokenObject<unknown>; | ||
export default AuthKitContext; |
@@ -8,3 +8,5 @@ "use strict"; | ||
exports.default = exports.AuthKitContext = void 0; | ||
exports.useReactAuthKitContext = useReactAuthKitContext; | ||
var _react = require("react"); | ||
var _errors = require("./errors"); | ||
function getContext() { | ||
@@ -18,2 +20,9 @@ var context = (0, _react.createContext)(null); | ||
var AuthKitContext = exports.AuthKitContext = getContext(); | ||
function useReactAuthKitContext() { | ||
var context = (0, _react.useContext)(AuthKitContext); | ||
if (context === null) { | ||
throw new _errors.AuthError('Auth Provider is missing. ' + 'Make sure, you are using this component inside the auth provider.'); | ||
} | ||
return context; | ||
} | ||
var _default = exports.default = AuthKitContext; |
{ | ||
"name": "react-auth-kit", | ||
"version": "3.0.2-alpha.4", | ||
"version": "3.0.2-alpha.8", | ||
"description": "Authentication Library for React, which makes Token based auth very easy", | ||
@@ -74,3 +74,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "899e1b8170f9b65eddc654d77ad050d6980f6cf9" | ||
"gitHead": "9cfaed1a5c4882232b201ceaa7a43e20302ab5d2" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
85798
2254