From 2c9129c7b6d1370198bc469f8b73f240d1b2f86e Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Tue, 18 Jun 2024 23:15:16 -0300 Subject: [PATCH] delete user auth if it is not logged in --- src/main/services/hydra-api.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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()) {