@iblai/web-utils 1.6.0 → 1.6.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/dist/index.d.ts +1 -1
- package/dist/index.esm.js +12 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +12 -3
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/web-utils/src/providers/auth-provider.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2879,6 +2879,10 @@ function useAuthProvider({ middleware = new Map(), onAuthSuccess, onAuthFailure,
|
|
|
2879
2879
|
* Skipped if enableStorageSync is false
|
|
2880
2880
|
*/
|
|
2881
2881
|
React.useEffect(() => {
|
|
2882
|
+
if (skipAuthCheck) {
|
|
2883
|
+
setInitialSyncComplete(true);
|
|
2884
|
+
return;
|
|
2885
|
+
}
|
|
2882
2886
|
console.log("[AuthProvider] cookie-sync effect running", {
|
|
2883
2887
|
pathname,
|
|
2884
2888
|
enableStorageSync,
|
|
@@ -2987,7 +2991,7 @@ function useAuthProvider({ middleware = new Map(), onAuthSuccess, onAuthFailure,
|
|
|
2987
2991
|
* Skipped if enableStorageSync is false
|
|
2988
2992
|
*/
|
|
2989
2993
|
React.useEffect(() => {
|
|
2990
|
-
if (!storageService || !isWeb$1() || !enableStorageSync)
|
|
2994
|
+
if (!storageService || !isWeb$1() || !enableStorageSync || skipAuthCheck)
|
|
2991
2995
|
return;
|
|
2992
2996
|
const handleStorageChange = async (event) => {
|
|
2993
2997
|
// Only handle changes to our auth-related keys
|
|
@@ -3087,6 +3091,11 @@ function useAuthProvider({ middleware = new Map(), onAuthSuccess, onAuthFailure,
|
|
|
3087
3091
|
}
|
|
3088
3092
|
}
|
|
3089
3093
|
React.useEffect(() => {
|
|
3094
|
+
if (skipAuthCheck) {
|
|
3095
|
+
setIsAuthenticating(false);
|
|
3096
|
+
setUserIsAccessingPublicRoute(true);
|
|
3097
|
+
return;
|
|
3098
|
+
}
|
|
3090
3099
|
// Wait for initial sync to complete before performing auth check
|
|
3091
3100
|
if (!initialSyncComplete) {
|
|
3092
3101
|
console.log("[useAuthProvider] Waiting for initial sync to complete...");
|
|
@@ -3164,7 +3173,7 @@ async function determineAuthRequired(middleware, pathname) {
|
|
|
3164
3173
|
* 4. Handles redirects to auth SPA when needed
|
|
3165
3174
|
* 5. Manages public route access state
|
|
3166
3175
|
*/
|
|
3167
|
-
function AuthProvider({ children, fallback, middleware = new Map(), onAuthSuccess, onAuthFailure, redirectToAuthSpa, hasNonExpiredAuthToken, username, pathname,
|
|
3176
|
+
function AuthProvider({ children, fallback, middleware = new Map(), onAuthSuccess, onAuthFailure, redirectToAuthSpa, hasNonExpiredAuthToken, username, pathname, storageService, token, enableStorageSync = true, skip = false, }) {
|
|
3168
3177
|
const { isAuthenticating, userIsAccessingPublicRoute, setUserIsAccessingPublicRoute, } = useAuthProvider({
|
|
3169
3178
|
middleware,
|
|
3170
3179
|
onAuthSuccess,
|
|
@@ -3174,7 +3183,7 @@ function AuthProvider({ children, fallback, middleware = new Map(), onAuthSucces
|
|
|
3174
3183
|
username,
|
|
3175
3184
|
pathname,
|
|
3176
3185
|
storageService,
|
|
3177
|
-
|
|
3186
|
+
skip,
|
|
3178
3187
|
token,
|
|
3179
3188
|
enableStorageSync,
|
|
3180
3189
|
});
|