@calimero-network/mero-react 4.1.0 → 4.1.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.cjs +13 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -268,14 +268,19 @@ function MeroProvider({
|
|
|
268
268
|
},
|
|
269
269
|
[timeoutMs, tokenStore]
|
|
270
270
|
);
|
|
271
|
-
const checkAuth = useCallback(
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
return
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
271
|
+
const checkAuth = useCallback(
|
|
272
|
+
async (instance) => {
|
|
273
|
+
const accessToken = tokenStore.getTokens()?.access_token;
|
|
274
|
+
if (!accessToken) return false;
|
|
275
|
+
try {
|
|
276
|
+
const { valid } = await instance.auth.validateToken(accessToken);
|
|
277
|
+
return valid;
|
|
278
|
+
} catch {
|
|
279
|
+
return false;
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
[tokenStore]
|
|
283
|
+
);
|
|
279
284
|
const connectToNode = useCallback(
|
|
280
285
|
(url) => {
|
|
281
286
|
if (!isBrowser) return;
|