Skip to content

Commit

Permalink
refactor: optimize authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
985563349 committed Dec 6, 2022
1 parent 03e8c69 commit 352945c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/contexts/AuthProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {

useEffect(() => {
(async () => {
if (hasAuth() && state.isAuthenticated === false) {
if (state.isReady === false && state.isAuthenticated === false) {
const user = await request('/user');
dispatch({ type: 'INITIALISED', user });
}
Expand Down

0 comments on commit 352945c

Please sign in to comment.