From cfc0e672effe3d7459ba4aed4dce2e17fe25360c Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Wed, 14 Jan 2026 17:05:42 +0100 Subject: [PATCH] Store refresh token in local storage For convenience to not have to log in everytime after closing the tab, opening a new tab, closing the browser/pwa app. closes #1018 --- CHANGELOG.md | 1 + src/features/authentication/AuthManager.ts | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb781a47..ddd26bca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). - (**Theme**) Change "pure black mode" paper background color to true black ### Changed +- (**General**) Preserve refresh token (UI Login) over sessions - (**Theme**) Improve automatic theme background colors - (**Theme**) Adjust "primary color" of dynamic color theme on manga pages - (**Theme**) Increase max length of custom theme names to 32 (previously 16) diff --git a/src/features/authentication/AuthManager.ts b/src/features/authentication/AuthManager.ts index d9cd7722..373952a7 100644 --- a/src/features/authentication/AuthManager.ts +++ b/src/features/authentication/AuthManager.ts @@ -93,7 +93,7 @@ export class AuthManager { } static getRefreshToken(): string | null { - return AppStorage.session.getItemParsed(AuthManager.REFRESH_TOKEN_KEY, null); + return AppStorage.local.getItemParsed(AuthManager.REFRESH_TOKEN_KEY, null); } static getTokens(): { accessToken: string | null; refreshToken: string | null } { @@ -124,7 +124,7 @@ export class AuthManager { } static setRefreshToken(token: string): void { - AppStorage.session.setItem(AuthManager.REFRESH_TOKEN_KEY, token); + AppStorage.local.setItem(AuthManager.REFRESH_TOKEN_KEY, token); AuthManager.notify(); } @@ -139,7 +139,7 @@ export class AuthManager { } static removeRefreshToken(): void { - AppStorage.session.setItem(AuthManager.REFRESH_TOKEN_KEY, undefined); + AppStorage.local.setItem(AuthManager.REFRESH_TOKEN_KEY, undefined); AuthManager.notify(); }