@frontegg/react-hooks 6.131.0 → 6.132.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/FronteggProvider/index.js +9 -11
- package/index.js +1 -1
- package/node/FronteggProvider/index.js +9 -11
- package/node/index.js +1 -1
- package/package.json +3 -3
|
@@ -63,7 +63,7 @@ const FronteggContent = ({
|
|
|
63
63
|
app,
|
|
64
64
|
setLoading
|
|
65
65
|
}) => {
|
|
66
|
-
var _app$options, _app$options2
|
|
66
|
+
var _app$options, _app$options2;
|
|
67
67
|
const {
|
|
68
68
|
isLoading
|
|
69
69
|
} = useAuth(({
|
|
@@ -73,9 +73,7 @@ const FronteggContent = ({
|
|
|
73
73
|
}));
|
|
74
74
|
const customLoginBox = !app || (app == null ? void 0 : (_app$options = app.options) == null ? void 0 : _app$options.customLoginBox) === true;
|
|
75
75
|
const isNextJS = (app == null ? void 0 : (_app$options2 = app.options) == null ? void 0 : _app$options2.framework) === 'nextjs';
|
|
76
|
-
const
|
|
77
|
-
const shouldShowChildrenOnHostedLogin = isHostedLoginBox && (app == null ? void 0 : (_app$options4 = app.options) == null ? void 0 : (_app$options4$authOpt = _app$options4.authOptions) == null ? void 0 : (_app$options4$authOpt2 = _app$options4$authOpt.hostedLoginOptions) == null ? void 0 : _app$options4$authOpt2.loadUserOnFirstLoad) !== true;
|
|
78
|
-
const alwaysShowChildren = customLoginBox || isNextJS || shouldShowChildrenOnHostedLogin;
|
|
76
|
+
const alwaysShowChildren = customLoginBox || isNextJS;
|
|
79
77
|
const loadingRef = useRef(undefined);
|
|
80
78
|
if (isLoading !== loadingRef.current && !isNextJS) {
|
|
81
79
|
loadingRef.current = isLoading;
|
|
@@ -95,7 +93,7 @@ const FronteggContent = ({
|
|
|
95
93
|
});
|
|
96
94
|
};
|
|
97
95
|
export const FronteggStoreProvider = props => {
|
|
98
|
-
var _app$options$contextO, _app$
|
|
96
|
+
var _app$options$contextO, _app$options3, _app$options$previewM, _app$options4, _app$options5, _app$options6;
|
|
99
97
|
const {
|
|
100
98
|
children,
|
|
101
99
|
app,
|
|
@@ -105,23 +103,23 @@ export const FronteggStoreProvider = props => {
|
|
|
105
103
|
} = props;
|
|
106
104
|
|
|
107
105
|
// TODO: make this optionals more readable
|
|
108
|
-
const context = (_app$options$contextO = app == null ? void 0 : (_app$
|
|
106
|
+
const context = (_app$options$contextO = app == null ? void 0 : (_app$options3 = app.options) == null ? void 0 : _app$options3.contextOptions) != null ? _app$options$contextO : contextOptions;
|
|
109
107
|
if (!context) {
|
|
110
108
|
throw Error('contextOptions must not be null or undefined');
|
|
111
109
|
}
|
|
112
|
-
const previewMode = (_app$options$previewM = app == null ? void 0 : (_app$
|
|
113
|
-
const authOptions = app != null && (_app$
|
|
110
|
+
const previewMode = (_app$options$previewM = app == null ? void 0 : (_app$options4 = app.options) == null ? void 0 : _app$options4.previewMode) != null ? _app$options$previewM : false;
|
|
111
|
+
const authOptions = app != null && (_app$options5 = app.options) != null && _app$options5.authOptions ? _extends({}, app.options.authOptions, {
|
|
114
112
|
hostedLoginBox: app.options.hostedLoginBox
|
|
115
113
|
}) : {
|
|
116
|
-
hostedLoginBox: app == null ? void 0 : (_app$
|
|
114
|
+
hostedLoginBox: app == null ? void 0 : (_app$options6 = app.options) == null ? void 0 : _app$options6.hostedLoginBox
|
|
117
115
|
};
|
|
118
116
|
ContextHolder.setContext(context);
|
|
119
117
|
const store = useMemo(() => {
|
|
120
|
-
var _app$name, _app$
|
|
118
|
+
var _app$name, _app$options7;
|
|
121
119
|
return createFronteggStore({
|
|
122
120
|
context,
|
|
123
121
|
appName: (_app$name = app == null ? void 0 : app.name) != null ? _app$name : 'default'
|
|
124
|
-
}, app, previewMode, authOptions, undefined, false, app == null ? void 0 : (_app$
|
|
122
|
+
}, app, previewMode, authOptions, undefined, false, app == null ? void 0 : (_app$options7 = app.options) == null ? void 0 : _app$options7.urlStrategy);
|
|
125
123
|
}, [app, previewMode]);
|
|
126
124
|
return /*#__PURE__*/_jsxs(Provider, {
|
|
127
125
|
context: FronteggStoreContext,
|
package/index.js
CHANGED
|
@@ -70,7 +70,7 @@ const FronteggContent = ({
|
|
|
70
70
|
app,
|
|
71
71
|
setLoading
|
|
72
72
|
}) => {
|
|
73
|
-
var _app$options, _app$options2
|
|
73
|
+
var _app$options, _app$options2;
|
|
74
74
|
const {
|
|
75
75
|
isLoading
|
|
76
76
|
} = (0, _auth.useAuth)(({
|
|
@@ -80,9 +80,7 @@ const FronteggContent = ({
|
|
|
80
80
|
}));
|
|
81
81
|
const customLoginBox = !app || (app == null ? void 0 : (_app$options = app.options) == null ? void 0 : _app$options.customLoginBox) === true;
|
|
82
82
|
const isNextJS = (app == null ? void 0 : (_app$options2 = app.options) == null ? void 0 : _app$options2.framework) === 'nextjs';
|
|
83
|
-
const
|
|
84
|
-
const shouldShowChildrenOnHostedLogin = isHostedLoginBox && (app == null ? void 0 : (_app$options4 = app.options) == null ? void 0 : (_app$options4$authOpt = _app$options4.authOptions) == null ? void 0 : (_app$options4$authOpt2 = _app$options4$authOpt.hostedLoginOptions) == null ? void 0 : _app$options4$authOpt2.loadUserOnFirstLoad) !== true;
|
|
85
|
-
const alwaysShowChildren = customLoginBox || isNextJS || shouldShowChildrenOnHostedLogin;
|
|
83
|
+
const alwaysShowChildren = customLoginBox || isNextJS;
|
|
86
84
|
const loadingRef = (0, _react.useRef)(undefined);
|
|
87
85
|
if (isLoading !== loadingRef.current && !isNextJS) {
|
|
88
86
|
loadingRef.current = isLoading;
|
|
@@ -102,7 +100,7 @@ const FronteggContent = ({
|
|
|
102
100
|
});
|
|
103
101
|
};
|
|
104
102
|
const FronteggStoreProvider = props => {
|
|
105
|
-
var _app$options$contextO, _app$
|
|
103
|
+
var _app$options$contextO, _app$options3, _app$options$previewM, _app$options4, _app$options5, _app$options6;
|
|
106
104
|
const {
|
|
107
105
|
children,
|
|
108
106
|
app,
|
|
@@ -112,23 +110,23 @@ const FronteggStoreProvider = props => {
|
|
|
112
110
|
} = props;
|
|
113
111
|
|
|
114
112
|
// TODO: make this optionals more readable
|
|
115
|
-
const context = (_app$options$contextO = app == null ? void 0 : (_app$
|
|
113
|
+
const context = (_app$options$contextO = app == null ? void 0 : (_app$options3 = app.options) == null ? void 0 : _app$options3.contextOptions) != null ? _app$options$contextO : contextOptions;
|
|
116
114
|
if (!context) {
|
|
117
115
|
throw Error('contextOptions must not be null or undefined');
|
|
118
116
|
}
|
|
119
|
-
const previewMode = (_app$options$previewM = app == null ? void 0 : (_app$
|
|
120
|
-
const authOptions = app != null && (_app$
|
|
117
|
+
const previewMode = (_app$options$previewM = app == null ? void 0 : (_app$options4 = app.options) == null ? void 0 : _app$options4.previewMode) != null ? _app$options$previewM : false;
|
|
118
|
+
const authOptions = app != null && (_app$options5 = app.options) != null && _app$options5.authOptions ? (0, _extends2.default)({}, app.options.authOptions, {
|
|
121
119
|
hostedLoginBox: app.options.hostedLoginBox
|
|
122
120
|
}) : {
|
|
123
|
-
hostedLoginBox: app == null ? void 0 : (_app$
|
|
121
|
+
hostedLoginBox: app == null ? void 0 : (_app$options6 = app.options) == null ? void 0 : _app$options6.hostedLoginBox
|
|
124
122
|
};
|
|
125
123
|
_restApi.ContextHolder.setContext(context);
|
|
126
124
|
const store = (0, _react.useMemo)(() => {
|
|
127
|
-
var _app$name, _app$
|
|
125
|
+
var _app$name, _app$options7;
|
|
128
126
|
return (0, _reduxStore.createFronteggStore)({
|
|
129
127
|
context,
|
|
130
128
|
appName: (_app$name = app == null ? void 0 : app.name) != null ? _app$name : 'default'
|
|
131
|
-
}, app, previewMode, authOptions, undefined, false, app == null ? void 0 : (_app$
|
|
129
|
+
}, app, previewMode, authOptions, undefined, false, app == null ? void 0 : (_app$options7 = app.options) == null ? void 0 : _app$options7.urlStrategy);
|
|
132
130
|
}, [app, previewMode]);
|
|
133
131
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_FronteggStoreContext.Provider, {
|
|
134
132
|
context: _FronteggStoreContext.FronteggStoreContext,
|
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.132.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.132.0",
|
|
10
|
+
"@frontegg/types": "6.132.0",
|
|
11
11
|
"@types/react": "*",
|
|
12
12
|
"get-value": "^3.0.1",
|
|
13
13
|
"react-redux": "^7.x"
|