Open pszafer opened 3 years ago
it seems that for some reason setState
is not working (it is called but old value of googleUser is available in fetchWithRefresh)...
https://github.com/asyarb/react-use-googlelogin/blob/093862e99c3a9b9372a33516ebe6e59cc682785d/src/index.tsx#L222-L242
Hi,
I basically copied code from this example: https://github.com/asyarb/react-use-googlelogin/blob/34f5b437a36d694859e113a4305b37a76f86bd91/examples/ssr-nextjs/src/components/GoogleAuthProvider.tsx#L93
refreshUser()
never refreshses expiresAt value so after an hour when first achieved token expired with each fetch app is going into this ifif (shouldRefreshToken)