authscape 1.0.408 → 1.0.410
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/index.js +9 -2
- package/package.json +1 -1
- package/src/components/AuthScapeApp.js +7 -6
package/index.js
CHANGED
|
@@ -156,7 +156,13 @@ function AuthScapeApp(_ref) {
|
|
|
156
156
|
case 6:
|
|
157
157
|
setFrontEndLoadedState(true);
|
|
158
158
|
frontEndLoaded.current = true;
|
|
159
|
-
|
|
159
|
+
if (!enforceLoggedIn) {
|
|
160
|
+
_context2.next = 11;
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
_context2.next = 11;
|
|
164
|
+
return authService().login();
|
|
165
|
+
case 11:
|
|
160
166
|
case "end":
|
|
161
167
|
return _context2.stop();
|
|
162
168
|
}
|
|
@@ -189,7 +195,8 @@ function AuthScapeApp(_ref) {
|
|
|
189
195
|
currentUser: signedInUser.current
|
|
190
196
|
}), layout == null && /*#__PURE__*/_react["default"].createElement(Component, _extends({}, pageProps, {
|
|
191
197
|
currentUser: signedInUser.current,
|
|
192
|
-
toast: _reactToastify.toast
|
|
198
|
+
toast: _reactToastify.toast,
|
|
199
|
+
loadedUser: frontEndLoadedState
|
|
193
200
|
}))), /*#__PURE__*/_react["default"].createElement(_reactToastify.ToastContainer, null)), frontEndLoaded.current && process.env.microsoftClarityTrackingCode != null && process.env.staging == "production" && /*#__PURE__*/_react["default"].createElement("script", {
|
|
194
201
|
dangerouslySetInnerHTML: {
|
|
195
202
|
__html: "\n (function(c,l,a,r,i,t,y){\n c[a] = c[a] || function () { (c[a].q = c[a].q || []).push(arguments) };\n t=l.createElement(r);\n t.async=1;\n t.src=\"https://www.clarity.ms/tag/\"+i;\n y=l.getElementsByTagName(r)[0];\n y.parentNode.insertBefore(t,y);\n })(window, document, \"clarity\", \"script\", \"" + process.env.microsoftClarityTrackingCode + "\");"
|
package/package.json
CHANGED
|
@@ -21,11 +21,8 @@ export function AuthScapeApp ({Component, layout, pageProps, muiTheme = {}, enfo
|
|
|
21
21
|
const queryRef = searchParams.get('ref');
|
|
22
22
|
const queryCode = searchParams.get('code');
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
24
|
const pathname = usePathname();
|
|
27
25
|
|
|
28
|
-
|
|
29
26
|
const signInValidator = async (queryCode) => {
|
|
30
27
|
|
|
31
28
|
if (queryCodeUsed.current != queryCode)
|
|
@@ -103,7 +100,6 @@ export function AuthScapeApp ({Component, layout, pageProps, muiTheme = {}, enfo
|
|
|
103
100
|
}
|
|
104
101
|
}
|
|
105
102
|
|
|
106
|
-
|
|
107
103
|
const validateUserSignedIn = async () => {
|
|
108
104
|
|
|
109
105
|
loadingAuth.current = true;
|
|
@@ -116,9 +112,14 @@ export function AuthScapeApp ({Component, layout, pageProps, muiTheme = {}, enfo
|
|
|
116
112
|
signedInUser.current = usr;
|
|
117
113
|
}
|
|
118
114
|
}
|
|
119
|
-
|
|
115
|
+
|
|
120
116
|
setFrontEndLoadedState(true);
|
|
121
117
|
frontEndLoaded.current = true;
|
|
118
|
+
|
|
119
|
+
if (enforceLoggedIn)
|
|
120
|
+
{
|
|
121
|
+
await authService().login();
|
|
122
|
+
}
|
|
122
123
|
}
|
|
123
124
|
|
|
124
125
|
if (queryCode != null)
|
|
@@ -154,7 +155,7 @@ export function AuthScapeApp ({Component, layout, pageProps, muiTheme = {}, enfo
|
|
|
154
155
|
})}
|
|
155
156
|
|
|
156
157
|
{layout == null &&
|
|
157
|
-
<Component {...pageProps} currentUser={signedInUser.current} toast={toast} />
|
|
158
|
+
<Component {...pageProps} currentUser={signedInUser.current} toast={toast} loadedUser={frontEndLoadedState} />
|
|
158
159
|
}
|
|
159
160
|
</>
|
|
160
161
|
}
|