Skip to content

Commit 23436e1

Browse files
author
CloudLobster
committed
fix: handle 401 in PendingActionBanner — show 'session expired' instead of raw error
Root cause: when JWT expires, upgrade API returns 'Missing authorization token' which was displayed as ownership error. Now detects 401 and shows a clear 'reconnect wallet' message.
1 parent 9ac4817 commit 23436e1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

web/src/pages/Dashboard.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2695,6 +2695,12 @@ function PendingActionBanner({
26952695
window.location.href = '/dashboard';
26962696
return;
26972697
}
2698+
// Auth expired → prompt reconnect
2699+
if (upgradeRes.status === 401) {
2700+
setError('Session expired. Please disconnect and reconnect your wallet.');
2701+
setChecking(false);
2702+
return;
2703+
}
26982704
const errData = await upgradeRes.json().catch(() => ({}));
26992705
// If "already has Basename handle" — user already upgraded
27002706
if (errData.error?.includes('already has')) {
@@ -2725,6 +2731,11 @@ function PendingActionBanner({
27252731
window.location.href = '/dashboard';
27262732
return;
27272733
}
2734+
if (upgradeRes.status === 401) {
2735+
setError('Session expired. Please disconnect and reconnect your wallet.');
2736+
setChecking(false);
2737+
return;
2738+
}
27282739
const upgradeErr = await upgradeRes.json().catch(() => ({}));
27292740
if (upgradeErr.error?.includes('already has')) {
27302741
window.location.href = '/dashboard';

0 commit comments

Comments
 (0)