Skip to content

Commit

Permalink
Fix : skip silent-refresh on mount
Browse files Browse the repository at this point in the history
  • Loading branch information
oikkoikk committed Oct 7, 2023
1 parent acbe945 commit 0ef6193
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/hooks/useAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export default function useAuth() {
return res;
})
.catch(async () => {
setErrorToast(new Error(ErrorMessage.REFRESH));
await logout();
setErrorToast(new Error(ErrorMessage.REFRESH));
});

return response;
Expand All @@ -33,7 +33,9 @@ export default function useAuth() {
useQuery([QueryKeys.REFRESH], () => silentRefresh(), {
enabled: !!session,
refetchInterval: REFRESH_PERIOD,
refetchIntervalInBackground: true
refetchOnMount: false,
refetchOnWindowFocus: false,
refetchIntervalInBackground: true,
});

const login = async (googleResponse: GoogleLoginCredential) => {
Expand Down

0 comments on commit 0ef6193

Please sign in to comment.