Fixed build warnings
Some checks failed
armco-org/iam-client-sdk/pipeline/head There was a failure building this commit
Some checks failed
armco-org/iam-client-sdk/pipeline/head There was a failure building this commit
This commit is contained in:
8
dist/react.js
vendored
8
dist/react.js
vendored
@@ -643,16 +643,18 @@ function useHasRole(roles) {
|
||||
function withAuth(WrappedComponent, options) {
|
||||
return function AuthenticatedComponent(props) {
|
||||
const { isAuthenticated, isLoading, user } = useAuth();
|
||||
const LoadingComp = options?.LoadingComponent;
|
||||
const UnauthorizedComp = options?.UnauthorizedComponent;
|
||||
if (isLoading) {
|
||||
return options?.LoadingComponent ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(options.LoadingComponent, {}) : null;
|
||||
return LoadingComp ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LoadingComp, {}) : null;
|
||||
}
|
||||
if (!isAuthenticated) {
|
||||
return options?.UnauthorizedComponent ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(options.UnauthorizedComponent, {}) : null;
|
||||
return UnauthorizedComp ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(UnauthorizedComp, {}) : null;
|
||||
}
|
||||
if (options?.roles && options.roles.length > 0) {
|
||||
const hasRequiredRole = options.roles.some((role) => user?.roles?.includes(role));
|
||||
if (!hasRequiredRole) {
|
||||
return options?.UnauthorizedComponent ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(options.UnauthorizedComponent, {}) : null;
|
||||
return UnauthorizedComp ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(UnauthorizedComp, {}) : null;
|
||||
}
|
||||
}
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(WrappedComponent, { ...props });
|
||||
|
||||
2
dist/react.js.map
vendored
2
dist/react.js.map
vendored
File diff suppressed because one or more lines are too long
8
dist/react.mjs
vendored
8
dist/react.mjs
vendored
@@ -620,16 +620,18 @@ function useHasRole(roles) {
|
||||
function withAuth(WrappedComponent, options) {
|
||||
return function AuthenticatedComponent(props) {
|
||||
const { isAuthenticated, isLoading, user } = useAuth();
|
||||
const LoadingComp = options?.LoadingComponent;
|
||||
const UnauthorizedComp = options?.UnauthorizedComponent;
|
||||
if (isLoading) {
|
||||
return options?.LoadingComponent ? /* @__PURE__ */ jsx(options.LoadingComponent, {}) : null;
|
||||
return LoadingComp ? /* @__PURE__ */ jsx(LoadingComp, {}) : null;
|
||||
}
|
||||
if (!isAuthenticated) {
|
||||
return options?.UnauthorizedComponent ? /* @__PURE__ */ jsx(options.UnauthorizedComponent, {}) : null;
|
||||
return UnauthorizedComp ? /* @__PURE__ */ jsx(UnauthorizedComp, {}) : null;
|
||||
}
|
||||
if (options?.roles && options.roles.length > 0) {
|
||||
const hasRequiredRole = options.roles.some((role) => user?.roles?.includes(role));
|
||||
if (!hasRequiredRole) {
|
||||
return options?.UnauthorizedComponent ? /* @__PURE__ */ jsx(options.UnauthorizedComponent, {}) : null;
|
||||
return UnauthorizedComp ? /* @__PURE__ */ jsx(UnauthorizedComp, {}) : null;
|
||||
}
|
||||
}
|
||||
return /* @__PURE__ */ jsx(WrappedComponent, { ...props });
|
||||
|
||||
2
dist/react.mjs.map
vendored
2
dist/react.mjs.map
vendored
File diff suppressed because one or more lines are too long
@@ -7,14 +7,14 @@
|
||||
"types": "dist/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts"
|
||||
"require": "./dist/index.js"
|
||||
},
|
||||
"./react": {
|
||||
"types": "./dist/react.d.ts",
|
||||
"import": "./dist/react.mjs",
|
||||
"require": "./dist/react.js",
|
||||
"types": "./dist/react.d.ts"
|
||||
"require": "./dist/react.js"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
|
||||
Reference in New Issue
Block a user