@digitaldefiance/express-suite-react-components 2.3.0 → 2.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/package.json +1 -1
- package/src/auth/UnAuth.d.ts +7 -0
- package/src/auth/UnAuth.d.ts.map +1 -0
- package/src/auth/UnAuth.js +13 -0
- package/src/auth/index.d.ts +1 -0
- package/src/auth/index.d.ts.map +1 -1
- package/src/auth/index.js +1 -0
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnAuth.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/auth/UnAuth.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,SAAS,EAAc,MAAM,OAAO,CAAC;AAGlD,UAAU,WAAW;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,QAAA,MAAM,MAAM,EAAE,EAAE,CAAC,WAAW,CAQ3B,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const AuthProvider_1 = require("../contexts/AuthProvider");
|
|
6
|
+
const UnAuth = ({ children }) => {
|
|
7
|
+
const { isAuthenticated, isCheckingAuth } = (0, react_1.useContext)(AuthProvider_1.AuthContext);
|
|
8
|
+
if (isCheckingAuth || isAuthenticated) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
|
|
12
|
+
};
|
|
13
|
+
exports.default = UnAuth;
|
package/src/auth/index.d.ts
CHANGED
package/src/auth/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAA"}
|
package/src/auth/index.js
CHANGED
|
@@ -7,3 +7,4 @@ Object.defineProperty(exports, "PrivateRoute", { enumerable: true, get: function
|
|
|
7
7
|
var UnAuthRoute_1 = require("./UnAuthRoute");
|
|
8
8
|
Object.defineProperty(exports, "UnAuthRoute", { enumerable: true, get: function () { return tslib_1.__importDefault(UnAuthRoute_1).default; } });
|
|
9
9
|
tslib_1.__exportStar(require("./Private"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./UnAuth"), exports);
|