fix: resolve telegram auth token expiration and clean up codebase

- Fix stale initData comparison in clearStaleSessionIfNeeded that destroyed
  valid refresh tokens on mobile WebView reopens
- Restrict X-Telegram-Init-Data header to auth endpoints only
- Close Mini App on auth retry to force fresh initData from Telegram
- Merge Connection page error/not-configured states for better UX
- Remove unnecessary comments across 40+ files (section dividers,
  restating comments, noise catch block comments)
- Configure ESLint allowEmptyCatch to properly handle intentional
  empty catch blocks (62 warnings resolved)
This commit is contained in:
c0mrade
2026-03-13 17:50:49 +03:00
parent 682b6b70dc
commit 2dab25c5a0
43 changed files with 72 additions and 647 deletions

View File

@@ -433,7 +433,6 @@ export default function AdminUserDetail() {
const data = await adminUsersApi.getReferrals(userId, 0, 50);
setReferrals(data.users);
} catch {
// ignore
} finally {
setReferralsLoading(false);
}
@@ -446,7 +445,6 @@ export default function AdminUserDetail() {
const data = await adminUsersApi.getPanelInfo(userId);
setPanelInfo(data);
} catch {
// ignore
} finally {
setPanelInfoLoading(false);
}
@@ -457,9 +455,7 @@ export default function AdminUserDetail() {
try {
const data = await adminUsersApi.getNodeUsage(userId);
setNodeUsage(data);
} catch {
// ignore
}
} catch {}
}, [userId]);
const loadDevices = useCallback(async () => {
@@ -471,7 +467,6 @@ export default function AdminUserDetail() {
setDevicesTotal(data.total);
setDeviceLimit(data.device_limit);
} catch {
// ignore
} finally {
setDevicesLoading(false);
}
@@ -488,7 +483,6 @@ export default function AdminUserDetail() {
const data = await adminUsersApi.getUserGifts(userId);
setGiftsData(data);
} catch {
// ignore
} finally {
setGiftsLoading(false);
}
@@ -498,9 +492,7 @@ export default function AdminUserDetail() {
try {
const data = await promocodesApi.getPromoGroups({ limit: 100 });
setPromoGroups(data.items);
} catch {
// ignore
}
} catch {}
}, []);
const handleTicketReply = async () => {
@@ -954,9 +946,7 @@ export default function AdminUserDetail() {
try {
await navigator.clipboard.writeText(text);
notify.success(t('admin.users.detail.copied'));
} catch {
// ignore
}
} catch {}
};
if (loading) {