Skip to content

Commit

Permalink
Merge 948ffb2 into 5889b24
Browse files Browse the repository at this point in the history
  • Loading branch information
jona18 committed Feb 23, 2022
2 parents 5889b24 + 948ffb2 commit 73b80c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/useOauth.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ const useOauth = (config = {}, logoutUrl = '') => {
let mounted = true;

const initialAuthData = {isLogged: false, oauthTokens: null};
const initialUserData = {};

const [authData, setAuthData] = useState(initialAuthData);
const [userData, setUserData] = useState(null);
const [userData, setUserData] = useState(initialUserData);
const [loading, setLoading] = useState(true);
const [error, setError] = useState(false);

Expand Down
2 changes: 1 addition & 1 deletion test/useOauth.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,6 @@ describe('useOauth hook', () => {
);
const {result, waitForNextUpdate} = renderHook(() => useOauth());
await waitForNextUpdate();
expect(result.current.userData).toBeNull();
expect(result.current.userData).toEqual({});
});
});

0 comments on commit 73b80c0

Please sign in to comment.