We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5355867 commit 4973950Copy full SHA for 4973950
frontend/src/auth/hooks/useCustomAuth.tsx
@@ -39,6 +39,15 @@ export function useCustomAuth(): {
39
[logout, userAuthorization, auth?.user?.profile?.email]
40
)
41
42
+ useEffect(
43
+ () =>
44
+ // the `return` is important - addAccessTokenExpiring() returns a cleanup function
45
+ auth?.events?.addAccessTokenExpiring(() => {
46
+ auth?.signinSilent()
47
+ }),
48
+ [auth]
49
+ )
50
+
51
useEffect(() => {
52
if (!auth) {
53
return
@@ -61,7 +70,7 @@ export function useCustomAuth(): {
61
70
const nextUserAuthorization = await getCurrentUserAuthorization()
62
71
63
72
setUserAuthorization(nextUserAuthorization)
64
- }, 250)
73
+ }, 500)
65
74
}
66
75
}, [
67
76
auth,
0 commit comments