From 8b707dfc1b1f57512169bc4c557c5c8c74f90cbd Mon Sep 17 00:00:00 2001 From: neoapps-dev Date: Tue, 16 Jun 2026 20:06:13 +0300 Subject: [PATCH] fix: logout on session expire --- src/services/LceLiveService.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/services/LceLiveService.ts b/src/services/LceLiveService.ts index 40270ee..39eeae8 100644 --- a/src/services/LceLiveService.ts +++ b/src/services/LceLiveService.ts @@ -132,7 +132,10 @@ export class LceLiveService { if (authed && this._session?.refreshToken && retryCount === 0) { try { await this.refreshSession(); //neo: i do this on every request only because it doesnt always return 401 - } catch (err) {} + } catch (err) { + this.logoutLocal(); + throw new Error("Session expired. Please log in again."); + } } const headers: Record = { @@ -220,7 +223,11 @@ export class LceLiveService { this._session = { accessToken: data.accessToken, refreshToken: data.refreshToken ?? "", - account: data.account ?? { accountId: "", username: "", displayName: "" }, + account: data.account ?? { + accountId: "", + username: "", + displayName: "", + }, }; this.saveSession(); }