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 72275b6 commit dadf6f1Copy full SHA for dadf6f1
hooks/useConnectionDetails.ts
@@ -64,10 +64,10 @@ export default function useConnectionDetails(appConfig: AppConfig) {
64
if (!jwtPayload.exp) {
65
return true;
66
}
67
- const expiresAt = new Date(jwtPayload.exp - ONE_MINUTE_IN_MILLISECONDS);
+ const expiresAt = new Date(jwtPayload.exp * 1000 - ONE_MINUTE_IN_MILLISECONDS);
68
69
const now = new Date();
70
- return expiresAt >= now;
+ return expiresAt <= now;
71
}, [connectionDetails?.participantToken]);
72
73
const existingOrRefreshConnectionDetails = useCallback(async () => {
0 commit comments