diff --git a/public/my.html b/public/my.html index 94fac9e..909236e 100644 --- a/public/my.html +++ b/public/my.html @@ -31,5 +31,5 @@ - + diff --git a/public/my.js b/public/my.js index 72c5fb2..0e8d981 100644 --- a/public/my.js +++ b/public/my.js @@ -419,7 +419,7 @@ const sig=await eth.request({method:'personal_sign',params:[hex,account]}); const v=await(await fetch('/api/public/msg-verify',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({address:account,signature:sig})})).json(); if(!v.ok)throw new Error(v.error||'Verification failed.'); - try{ if(window.RMCProfile)await window.RMCProfile.require(); }catch(ge){} + try{ if(window.RMCProfile)await window.RMCProfile.require({onlyForId:d&&d.id}); }catch(ge){} loadMsgUI(d); }catch(e){if(err)err.textContent=e.message||String(e);} } @@ -759,5 +759,5 @@ if(id)load(id); // Required member profile (username + verified email). No-ops for a visitor who // has not proved they own a position: the API 401s and the gate never shows. - try{ if(window.RMCProfile)window.RMCProfile.require(); }catch(e){} + try{ if(window.RMCProfile&&id)window.RMCProfile.require({onlyForId:id}); }catch(e){} })(); diff --git a/public/profile-gate.js b/public/profile-gate.js index 38ad5e0..9f24fa0 100644 --- a/public/profile-gate.js +++ b/public/profile-gate.js @@ -164,11 +164,15 @@ // Resolves once the profile is complete. Safe to call repeatedly: it returns // immediately when there is nothing to collect, and never shows for a visitor - // who has not proved they own the position (the API 401s them). - async function require_() { + // who has not proved they own the position. + // opts.onlyForId: only gate when the page being viewed IS this member's own + // position (Marty, 2026-09-16), so browsing a teammate's dashboard never prompts. + async function require_(opts) { try { state = await api('/api/public/profile'); } catch (e) { return null; } if (!state || state.signedIn === false) return null; // a visitor on a shared link: never gate + var only = opts && opts.onlyForId; + if (only && Number(only) !== Number(state.id)) return null; if (state.profile && state.profile.complete) return state.profile; if (back) return null; // already open shell();