tenneo-auth-plugin 0.1.10 → 0.1.11
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.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2955,9 +2955,9 @@ function AuthProvider({
|
|
|
2955
2955
|
};
|
|
2956
2956
|
}, [resolvedTenantKey, appId, storageAdapter]);
|
|
2957
2957
|
useEffect(() => {
|
|
2958
|
-
const resolvedTenantKey2 =
|
|
2958
|
+
const resolvedTenantKey2 = mergedTenantCode ?? Config.getClientCode();
|
|
2959
2959
|
logger.debug("[AuthProvider] Props from host app", {
|
|
2960
|
-
tenantCode:
|
|
2960
|
+
tenantCode: mergedTenantCode ?? "(not provided)",
|
|
2961
2961
|
appId: appId ?? "",
|
|
2962
2962
|
resolvedTenantKey: resolvedTenantKey2
|
|
2963
2963
|
});
|
|
@@ -3005,7 +3005,7 @@ function AuthProvider({
|
|
|
3005
3005
|
} else {
|
|
3006
3006
|
logger.debug("[AuthProvider] No tenant code determined");
|
|
3007
3007
|
}
|
|
3008
|
-
}, [
|
|
3008
|
+
}, [mergedTenantCode, appId]);
|
|
3009
3009
|
const [state, setState] = useState({
|
|
3010
3010
|
isAuthenticated: false,
|
|
3011
3011
|
accessToken: null,
|
|
@@ -3069,7 +3069,7 @@ function AuthProvider({
|
|
|
3069
3069
|
return () => {
|
|
3070
3070
|
cancelled = true;
|
|
3071
3071
|
};
|
|
3072
|
-
}, [autoInit,
|
|
3072
|
+
}, [autoInit, mergedTenantCode, syncAuthState]);
|
|
3073
3073
|
useEffect(() => {
|
|
3074
3074
|
if (!autoInit) {
|
|
3075
3075
|
setState((prev) => ({ ...prev, isLoading: false }));
|
|
@@ -3113,7 +3113,7 @@ function AuthProvider({
|
|
|
3113
3113
|
stopCookieWatcher();
|
|
3114
3114
|
setState((prev) => ({ ...prev, isLoading: true }));
|
|
3115
3115
|
try {
|
|
3116
|
-
await engineRef.current?.logout({ tenantKey:
|
|
3116
|
+
await engineRef.current?.logout({ tenantKey: mergedTenantCode });
|
|
3117
3117
|
resetCookieWatcher();
|
|
3118
3118
|
} finally {
|
|
3119
3119
|
stopStorageWatcher();
|
|
@@ -3125,7 +3125,7 @@ function AuthProvider({
|
|
|
3125
3125
|
error: null
|
|
3126
3126
|
});
|
|
3127
3127
|
}
|
|
3128
|
-
}, [
|
|
3128
|
+
}, [mergedTenantCode]);
|
|
3129
3129
|
const refreshToken = useCallback(async () => {
|
|
3130
3130
|
try {
|
|
3131
3131
|
const newToken = await engineRef.current?.refresh() ?? "";
|