diff --git a/src/main/services/hydra-api.ts b/src/main/services/hydra-api.ts index 009d15ac..5e8e74b8 100644 --- a/src/main/services/hydra-api.ts +++ b/src/main/services/hydra-api.ts @@ -100,7 +100,10 @@ export class HydraApi { } private static async revalidateAccessTokenIfExpired() { - if (!this.userAuth.authToken) throw new Error("user is not logged in"); + if (!this.userAuth.authToken) { + userAuthRepository.delete({ id: 1 }); + throw new Error("user is not logged in"); + } const now = new Date(); if (this.userAuth.expirationTimestamp < now.getTime()) {