Fix: email-only members were locked out of the members area

refreshNavWallet assumed every signed-in session has a wallet address and
threw on null for email-only members; the catch returned null and render()
treated the member as signed out even though the session and cookie were
valid. Nav now shows the email (or member badge) when no wallet is linked.
Verified with a full browser cycle: session landing, logout, fresh code
sign-in. Assets v=20260904k.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-09-04 15:27:08 -05:00
parent a386c8e3a3
commit 547bff0d05
5 changed files with 23 additions and 20 deletions
+5 -2
View File
@@ -52,8 +52,11 @@ window.IAP = (function () {
const el = $('navWallet');
if (!el) return;
if (me.signedIn) {
el.innerHTML = (me.memberId ? '<span class="badge">member #' + me.memberId + '</span> ' : '')
+ '<span class="mono">' + me.address.slice(0, 6) + '…' + me.address.slice(-4) + '</span>';
// email-only members have no wallet address yet
const who = me.address
? '<span class="mono">' + me.address.slice(0, 6) + '…' + me.address.slice(-4) + '</span>'
: (me.email ? String(me.email).replace(/[&<>]/g, '') : 'signed in');
el.innerHTML = (me.memberId ? '<span class="badge">member #' + me.memberId + '</span> ' : '') + who;
} else {
el.innerHTML = '<a href="/my">Sign in</a>';
}