fix(auth): do not log out on transient network errors
Continuous Integration / build_web (push) Failing after 0s
Continuous Integration / build (macos-latest) (push) Skipped
Continuous Integration / build (ubuntu-22.04) (push) Skipped
Continuous Integration / build (windows-11-arm) (push) Skipped
Continuous Integration / build (windows-latest) (push) Skipped
Continuous Integration / nightly_release (push) Skipped

Only 401/403 clears the saved session; other failures keep the token. Routes without a token now redirect to login instead of showing a permanent spinner.
This commit is contained in:
1xDed committed 2026-11-28 01:44:00 +03:00
1 parent ae5a2133fa
commit 75b4ddd598
2 files changed
+47 -21

No files matched your search

+4
View File
@@ -70,6 +70,10 @@ function ProviderWrapper() {
if (api?.accessToken && !user?.Id) {
fetchCurrentUser(api).catch(async (error) => {
console.error("Could not restore the saved session", error);
const status = (error as { response?: { status?: number } })?.response
?.status;
// Only an actual authorization failure should log the user out.
if (status !== 401 && status !== 403) return;
await delUser();
createApi(api.basePath, undefined);
router.navigate({