fix: revalidate user token with no refresh page (#1842)

This commit is contained in:
Himself65
2023-04-07 17:51:51 -05:00
committed by GitHub
parent e50bf9fbfe
commit 20e56cc474
6 changed files with 83 additions and 41 deletions
@@ -40,10 +40,11 @@ describe('AFFiNE workspace', () => {
// but refresh is still valid
refresh: data.refresh,
});
renderHook(() => useAffineRefreshAuthToken(1));
const hook = renderHook(() => useAffineRefreshAuthToken(1));
await new Promise(resolve => setTimeout(resolve, 3000));
const userData = parseIdToken(getLoginStorage()?.token as string);
expect(userData).not.toBeNull();
expect(isExpired(userData)).toBe(false);
hook.unmount();
});
});