@frontegg/react-hooks 7.67.0 → 7.68.0-alpha.1
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/hooks.d.ts +1 -0
- package/auth/hooks.js +4 -0
- package/auth/index.d.ts +1 -1
- package/auth/index.js +1 -1
- package/common/CustomComponentHolder.js +4 -1
- package/index.js +1 -1
- package/node/auth/hooks.js +7 -2
- package/node/auth/index.js +8 -1
- package/node/common/CustomComponentHolder.js +4 -1
- package/node/index.js +1 -1
- package/package.json +3 -3
package/auth/hooks.d.ts
CHANGED
|
@@ -93,3 +93,4 @@ export declare const useAuthUser: () => User;
|
|
|
93
93
|
* Use this `frontegg` hook function to retrieve the authenticated user. If the user is not authenticated, this hook will return null. To redirect the user to the login page in case they are not authenticated, use the `useAuthUser` method.
|
|
94
94
|
*/
|
|
95
95
|
export declare const useAuthUserOrNull: () => User | null;
|
|
96
|
+
export declare const useStoreActions: () => import("@frontegg/redux-store").FronteggActions;
|
package/auth/hooks.js
CHANGED
package/auth/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { useAuthState, useAuth, useAuthActions, useOnRedirectTo, useAuthRoutes, useIsAuthenticated, useAuthUser, useAuthUserOrNull, useLoginWithRedirect, useLoginWithRedirectV2, } from './hooks';
|
|
1
|
+
export { useAuthState, useAuth, useAuthActions, useOnRedirectTo, useAuthRoutes, useIsAuthenticated, useAuthUser, useAuthUserOrNull, useLoginWithRedirect, useLoginWithRedirectV2, useStoreActions, } from './hooks';
|
|
2
2
|
export * from './acceptInvitation';
|
|
3
3
|
export * from './unlockAccount';
|
|
4
4
|
export * from './activateAccount';
|
package/auth/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { useAuthState, useAuth, useAuthActions, useOnRedirectTo, useAuthRoutes, useIsAuthenticated, useAuthUser, useAuthUserOrNull, useLoginWithRedirect, useLoginWithRedirectV2 } from './hooks';
|
|
1
|
+
export { useAuthState, useAuth, useAuthActions, useOnRedirectTo, useAuthRoutes, useIsAuthenticated, useAuthUser, useAuthUserOrNull, useLoginWithRedirect, useLoginWithRedirectV2, useStoreActions } from './hooks';
|
|
2
2
|
export * from './acceptInvitation';
|
|
3
3
|
export * from './unlockAccount';
|
|
4
4
|
export * from './activateAccount';
|
|
@@ -67,10 +67,13 @@ export const CustomComponentRegister = ({
|
|
|
67
67
|
return [];
|
|
68
68
|
}
|
|
69
69
|
const loop = (key, obj, keyPath) => {
|
|
70
|
+
if (key === 'overrideSignupFields') {
|
|
71
|
+
return [];
|
|
72
|
+
}
|
|
70
73
|
if (typeof obj !== 'object' && typeof obj !== 'function') {
|
|
71
74
|
return [];
|
|
72
75
|
}
|
|
73
|
-
if (typeof obj === 'function') {
|
|
76
|
+
if (typeof obj === 'function' && key) {
|
|
74
77
|
try {
|
|
75
78
|
const reactElement = /*#__PURE__*/React.createElement(obj, {
|
|
76
79
|
title: 'title'
|
package/index.js
CHANGED
package/node/auth/hooks.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.useAuth = useAuth;
|
|
7
7
|
exports.useAuthRoutes = exports.useAuthActions = void 0;
|
|
8
8
|
exports.useAuthState = useAuthState;
|
|
9
|
-
exports.useOnRedirectTo = exports.useLoginWithRedirectV2 = exports.useLoginWithRedirect = exports.useIsAuthenticated = exports.useAuthUserOrNull = exports.useAuthUser = void 0;
|
|
9
|
+
exports.useStoreActions = exports.useOnRedirectTo = exports.useLoginWithRedirectV2 = exports.useLoginWithRedirect = exports.useIsAuthenticated = exports.useAuthUserOrNull = exports.useAuthUser = void 0;
|
|
10
10
|
var _react = require("react");
|
|
11
11
|
var _restApi = require("@frontegg/rest-api");
|
|
12
12
|
var _FronteggStoreContext = require("../FronteggStoreContext");
|
|
@@ -178,4 +178,9 @@ const useAuthUserOrNull = () => {
|
|
|
178
178
|
} = useAuth();
|
|
179
179
|
return user || null;
|
|
180
180
|
};
|
|
181
|
-
exports.useAuthUserOrNull = useAuthUserOrNull;
|
|
181
|
+
exports.useAuthUserOrNull = useAuthUserOrNull;
|
|
182
|
+
const useStoreActions = () => {
|
|
183
|
+
const store = (0, _FronteggStoreContext.useStore)();
|
|
184
|
+
return store.actions;
|
|
185
|
+
};
|
|
186
|
+
exports.useStoreActions = useStoreActions;
|
package/node/auth/index.js
CHANGED
|
@@ -13,7 +13,8 @@ var _exportNames = {
|
|
|
13
13
|
useAuthUser: true,
|
|
14
14
|
useAuthUserOrNull: true,
|
|
15
15
|
useLoginWithRedirect: true,
|
|
16
|
-
useLoginWithRedirectV2: true
|
|
16
|
+
useLoginWithRedirectV2: true,
|
|
17
|
+
useStoreActions: true
|
|
17
18
|
};
|
|
18
19
|
Object.defineProperty(exports, "useAuth", {
|
|
19
20
|
enumerable: true,
|
|
@@ -75,6 +76,12 @@ Object.defineProperty(exports, "useOnRedirectTo", {
|
|
|
75
76
|
return _hooks.useOnRedirectTo;
|
|
76
77
|
}
|
|
77
78
|
});
|
|
79
|
+
Object.defineProperty(exports, "useStoreActions", {
|
|
80
|
+
enumerable: true,
|
|
81
|
+
get: function () {
|
|
82
|
+
return _hooks.useStoreActions;
|
|
83
|
+
}
|
|
84
|
+
});
|
|
78
85
|
var _hooks = require("./hooks");
|
|
79
86
|
var _acceptInvitation = require("./acceptInvitation");
|
|
80
87
|
Object.keys(_acceptInvitation).forEach(function (key) {
|
|
@@ -75,10 +75,13 @@ const CustomComponentRegister = ({
|
|
|
75
75
|
return [];
|
|
76
76
|
}
|
|
77
77
|
const loop = (key, obj, keyPath) => {
|
|
78
|
+
if (key === 'overrideSignupFields') {
|
|
79
|
+
return [];
|
|
80
|
+
}
|
|
78
81
|
if (typeof obj !== 'object' && typeof obj !== 'function') {
|
|
79
82
|
return [];
|
|
80
83
|
}
|
|
81
|
-
if (typeof obj === 'function') {
|
|
84
|
+
if (typeof obj === 'function' && key) {
|
|
82
85
|
try {
|
|
83
86
|
const reactElement = /*#__PURE__*/_react.default.createElement(obj, {
|
|
84
87
|
title: 'title'
|
package/node/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontegg/react-hooks",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.68.0-alpha.1",
|
|
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": "7.
|
|
10
|
-
"@frontegg/types": "7.
|
|
9
|
+
"@frontegg/redux-store": "7.68.0-alpha.1",
|
|
10
|
+
"@frontegg/types": "7.68.0-alpha.1",
|
|
11
11
|
"@types/react": "*",
|
|
12
12
|
"@types/react-is": "^17.0.7",
|
|
13
13
|
"get-value": "^3.0.1",
|