@frontegg/react-hooks 6.159.0-alpha.0 → 6.160.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/hooks.d.ts CHANGED
@@ -49,6 +49,7 @@ export declare function useAuth<S>(stateMapper: AuthStateMapper<S>): S;
49
49
  * When using this option, you can have the user on the first load, and you can control when the user is redirected to the login page by using `loginWithRedirect`.
50
50
  */
51
51
  export declare const useLoginWithRedirect: () => AuthActions['requestHostedLoginAuthorize'];
52
+ export declare const useLoginWithRedirectV2: () => AuthActions['requestHostedLoginAuthorizeV2'];
52
53
  export declare const useAuthActions: () => AuthActions;
53
54
  export declare const useOnRedirectTo: () => (path: string, opts?: RedirectOptions | undefined) => void;
54
55
  export declare const useAuthRoutes: () => AuthPageRoutes;
package/auth/hooks.js CHANGED
@@ -59,6 +59,10 @@ export const useLoginWithRedirect = () => {
59
59
  const dispatch = useDispatch();
60
60
  return useMemo(() => bindActionCreators(authActions.requestHostedLoginAuthorize, dispatch), [authActions.requestHostedLoginAuthorize]);
61
61
  };
62
+ export const useLoginWithRedirectV2 = () => {
63
+ const dispatch = useDispatch();
64
+ return useMemo(() => bindActionCreators(authActions.requestHostedLoginAuthorizeV2, dispatch), [authActions.requestHostedLoginAuthorizeV2]);
65
+ };
62
66
  export const useAuthActions = () => {
63
67
  const dispatch = useDispatch();
64
68
  return useMemo(() => bindActionCreators(authActions, dispatch), [authActions]);
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, useLoginWithRedirectV2, } from './hooks';
2
2
  export * from './acceptInvitation';
3
3
  export * from './activateAccount';
4
4
  export * from './apiTokens';
package/auth/index.js 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, useLoginWithRedirectV2 } from './hooks';
2
2
  export * from './acceptInvitation';
3
3
  export * from './activateAccount';
4
4
  export * from './apiTokens';
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v6.159.0-alpha.0
1
+ /** @license Frontegg v6.160.0
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.stateHookGenerator = exports.sliceReducerActionsBy = exports.reducerActionsGenerator = void 0;
8
8
  exports.useAuth = useAuth;
9
- exports.useOnRedirectTo = exports.useLoginWithRedirect = exports.useIsAuthenticated = exports.useAuthUserOrNull = exports.useAuthUser = exports.useAuthRoutes = exports.useAuthActions = void 0;
9
+ exports.useOnRedirectTo = exports.useLoginWithRedirectV2 = exports.useLoginWithRedirect = exports.useIsAuthenticated = exports.useAuthUserOrNull = exports.useAuthUser = exports.useAuthRoutes = exports.useAuthActions = void 0;
10
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
11
  var _react = require("react");
12
12
  var _reduxStore = require("@frontegg/redux-store");
@@ -68,6 +68,11 @@ const useLoginWithRedirect = () => {
68
68
  return (0, _react.useMemo)(() => (0, _reduxStore.bindActionCreators)(_reduxStore.authActions.requestHostedLoginAuthorize, dispatch), [_reduxStore.authActions.requestHostedLoginAuthorize]);
69
69
  };
70
70
  exports.useLoginWithRedirect = useLoginWithRedirect;
71
+ const useLoginWithRedirectV2 = () => {
72
+ const dispatch = (0, _FronteggStoreContext.useDispatch)();
73
+ return (0, _react.useMemo)(() => (0, _reduxStore.bindActionCreators)(_reduxStore.authActions.requestHostedLoginAuthorizeV2, dispatch), [_reduxStore.authActions.requestHostedLoginAuthorizeV2]);
74
+ };
75
+ exports.useLoginWithRedirectV2 = useLoginWithRedirectV2;
71
76
  const useAuthActions = () => {
72
77
  const dispatch = (0, _FronteggStoreContext.useDispatch)();
73
78
  return (0, _react.useMemo)(() => (0, _reduxStore.bindActionCreators)(_reduxStore.authActions, dispatch), [_reduxStore.authActions]);
@@ -11,7 +11,8 @@ var _exportNames = {
11
11
  useIsAuthenticated: true,
12
12
  useAuthUser: true,
13
13
  useAuthUserOrNull: true,
14
- useLoginWithRedirect: true
14
+ useLoginWithRedirect: true,
15
+ useLoginWithRedirectV2: true
15
16
  };
16
17
  Object.defineProperty(exports, "useAuth", {
17
18
  enumerable: true,
@@ -55,6 +56,12 @@ Object.defineProperty(exports, "useLoginWithRedirect", {
55
56
  return _hooks.useLoginWithRedirect;
56
57
  }
57
58
  });
59
+ Object.defineProperty(exports, "useLoginWithRedirectV2", {
60
+ enumerable: true,
61
+ get: function () {
62
+ return _hooks.useLoginWithRedirectV2;
63
+ }
64
+ });
58
65
  Object.defineProperty(exports, "useOnRedirectTo", {
59
66
  enumerable: true,
60
67
  get: function () {
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v6.159.0-alpha.0
1
+ /** @license Frontegg v6.160.0
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@frontegg/react-hooks",
3
- "version": "6.159.0-alpha.0",
3
+ "version": "6.160.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.159.0-alpha.0",
10
- "@frontegg/types": "6.159.0-alpha.0",
9
+ "@frontegg/redux-store": "6.160.0",
10
+ "@frontegg/types": "6.160.0",
11
11
  "@types/react": "*",
12
12
  "get-value": "^3.0.1",
13
13
  "react-redux": "^7.x"