From f85963a25304d260609845754b4081915d94aaba Mon Sep 17 00:00:00 2001 From: Wenderson Pires Date: Tue, 18 Apr 2023 12:40:17 -0300 Subject: [PATCH] Fixed an issue where the `auth.user` object was defined even when the user was not logged in. --- package.json | 2 +- src/auth/contexts/AuthProvider.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4b7106b..8811449 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "near-social-bridge", - "version": "1.3.4", + "version": "1.3.5", "description": "This library allows you to create a common application using ReactJS and inject it in a controlled way into a Widget on Near Social. Therefore, the Widget talks to the React application and vice versa, making it possible to consume Discovery API resources within the React application.", "main": "./dist/cjs/index.js", "module": "./index.js", diff --git a/src/auth/contexts/AuthProvider.tsx b/src/auth/contexts/AuthProvider.tsx index e4f1f68..afd73a8 100644 --- a/src/auth/contexts/AuthProvider.tsx +++ b/src/auth/contexts/AuthProvider.tsx @@ -38,7 +38,7 @@ const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => const onConnectHandler = () => { // Set the initial user info const preUserInfo = getConnectionPayload().userInfo - if (preUserInfo) { + if (preUserInfo?.accountId) { setUser(preUserInfo) }