@frontegg/react-hooks 6.34.0 → 6.35.0
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/auth/index.d.ts +1 -1
- package/auth/restrictions.d.ts +9 -0
- package/auth/restrictions.js +20 -0
- package/index.js +1 -1
- package/node/auth/restrictions.js +25 -2
- package/node/index.js +1 -1
- package/package.json +3 -3
package/auth/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { useAuth, useAuthActions, useOnRedirectTo, useAuthRoutes, useIsAuthenticated, useAuthUser, useAuthUserOrNull, useLoginWithRedirect } from './hooks';
|
|
1
|
+
export { useAuth, useAuthActions, useOnRedirectTo, useAuthRoutes, useIsAuthenticated, useAuthUser, useAuthUserOrNull, useLoginWithRedirect, } from './hooks';
|
|
2
2
|
export * from './acceptInvitation';
|
|
3
3
|
export * from './activateAccount';
|
|
4
4
|
export * from './apiTokens';
|
package/auth/restrictions.d.ts
CHANGED
|
@@ -15,3 +15,12 @@ export declare const useIpRestrictions: (loadOnMount?: boolean) => {
|
|
|
15
15
|
totalPages: number;
|
|
16
16
|
userIpValid: boolean;
|
|
17
17
|
};
|
|
18
|
+
export declare const useEmailDomainRestrictions: (loadOnMount?: boolean) => {
|
|
19
|
+
loading: boolean;
|
|
20
|
+
saving: boolean | undefined;
|
|
21
|
+
error: any;
|
|
22
|
+
data: {
|
|
23
|
+
config: import("@frontegg/rest-api").DomainRestrictionConfig;
|
|
24
|
+
restrictions: import("@frontegg/rest-api").DomainRestriction[];
|
|
25
|
+
} | undefined;
|
|
26
|
+
};
|
package/auth/restrictions.js
CHANGED
|
@@ -33,4 +33,24 @@ export const useIpRestrictions = (loadOnMount = false) => {
|
|
|
33
33
|
totalPages,
|
|
34
34
|
userIpValid
|
|
35
35
|
};
|
|
36
|
+
};
|
|
37
|
+
export const useEmailDomainRestrictions = (loadOnMount = false) => {
|
|
38
|
+
const {
|
|
39
|
+
loading,
|
|
40
|
+
data,
|
|
41
|
+
saving,
|
|
42
|
+
error
|
|
43
|
+
} = useRestrictionsState(state => state.emailDomainRestrictions);
|
|
44
|
+
const {
|
|
45
|
+
loadEmailDomainRestrictions
|
|
46
|
+
} = useRestrictionsActions();
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
(loadOnMount || !data) && loadEmailDomainRestrictions(); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
49
|
+
}, [loadOnMount, loadEmailDomainRestrictions]);
|
|
50
|
+
return {
|
|
51
|
+
loading,
|
|
52
|
+
saving,
|
|
53
|
+
error,
|
|
54
|
+
data
|
|
55
|
+
};
|
|
36
56
|
};
|
package/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.useRestrictionsActions = exports.useIpRestrictions = void 0;
|
|
6
|
+
exports.useRestrictionsActions = exports.useIpRestrictions = exports.useEmailDomainRestrictions = void 0;
|
|
7
7
|
exports.useRestrictionsState = useRestrictionsState;
|
|
8
8
|
|
|
9
9
|
var _reduxStore = require("@frontegg/redux-store");
|
|
@@ -49,4 +49,27 @@ const useIpRestrictions = (loadOnMount = false) => {
|
|
|
49
49
|
};
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
-
exports.useIpRestrictions = useIpRestrictions;
|
|
52
|
+
exports.useIpRestrictions = useIpRestrictions;
|
|
53
|
+
|
|
54
|
+
const useEmailDomainRestrictions = (loadOnMount = false) => {
|
|
55
|
+
const {
|
|
56
|
+
loading,
|
|
57
|
+
data,
|
|
58
|
+
saving,
|
|
59
|
+
error
|
|
60
|
+
} = useRestrictionsState(state => state.emailDomainRestrictions);
|
|
61
|
+
const {
|
|
62
|
+
loadEmailDomainRestrictions
|
|
63
|
+
} = useRestrictionsActions();
|
|
64
|
+
(0, _react.useEffect)(() => {
|
|
65
|
+
(loadOnMount || !data) && loadEmailDomainRestrictions(); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
66
|
+
}, [loadOnMount, loadEmailDomainRestrictions]);
|
|
67
|
+
return {
|
|
68
|
+
loading,
|
|
69
|
+
saving,
|
|
70
|
+
error,
|
|
71
|
+
data
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
exports.useEmailDomainRestrictions = useEmailDomainRestrictions;
|
package/node/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontegg/react-hooks",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.35.0",
|
|
4
4
|
"main": "./node/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Frontegg LTD",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@babel/runtime": "^7.18.6",
|
|
9
|
-
"@frontegg/redux-store": "6.
|
|
10
|
-
"@frontegg/types": "6.
|
|
9
|
+
"@frontegg/redux-store": "6.35.0",
|
|
10
|
+
"@frontegg/types": "6.35.0",
|
|
11
11
|
"@types/react": "*",
|
|
12
12
|
"react-redux": "^7.x"
|
|
13
13
|
},
|