Profile gate fires only on the member's own dashboard, not when they browse a teammate's page

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
martbost
2026-09-16 17:18:15 -05:00
parent dd74ded287
commit 1ea8f8df48
3 changed files with 9 additions and 5 deletions
+1 -1
View File
@@ -31,5 +31,5 @@
</section> </section>
</main> </main>
<footer class="wrap disclaimer">All figures are read live from the RM Circle smart contract on Polygon and are historical facts, not a promise of future results. Participation involves cryptocurrency and smart-contract risk. Never use funds you cannot afford to lose.<div class="footer-links"><a href="/">Home</a><a href="/contract">Contract Security</a><a href="/disclaimer">Disclaimers</a><a href="/tools">Promo Tools</a><a href="/privacy">Privacy</a><a href="/refunds">Refunds</a></div></footer> <footer class="wrap disclaimer">All figures are read live from the RM Circle smart contract on Polygon and are historical facts, not a promise of future results. Participation involves cryptocurrency and smart-contract risk. Never use funds you cannot afford to lose.<div class="footer-links"><a href="/">Home</a><a href="/contract">Contract Security</a><a href="/disclaimer">Disclaimers</a><a href="/tools">Promo Tools</a><a href="/privacy">Privacy</a><a href="/refunds">Refunds</a></div></footer>
<script src="/track.js"></script><script src="/qrlib.js"></script><script src="/rmc-wallet.js"></script><script src="/inapp-browser.js"></script><script src="/profile-gate.js?v=20260916b"></script><script src="/my.js"></script><script src="/payouts.js" defer></script><script src="/chat.js" defer></script><script src="/translate.js" defer></script><script src="/tg-app.js" defer></script><script src="/wallet-notice.js" defer></script> <script src="/announce.js?v=20260916a"></script> <script src="/track.js"></script><script src="/qrlib.js"></script><script src="/rmc-wallet.js"></script><script src="/inapp-browser.js"></script><script src="/profile-gate.js?v=20260916c"></script><script src="/my.js"></script><script src="/payouts.js" defer></script><script src="/chat.js" defer></script><script src="/translate.js" defer></script><script src="/tg-app.js" defer></script><script src="/wallet-notice.js" defer></script> <script src="/announce.js?v=20260916a"></script>
</body></html> </body></html>
+2 -2
View File
@@ -419,7 +419,7 @@
const sig=await eth.request({method:'personal_sign',params:[hex,account]}); 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(); 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.'); 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); loadMsgUI(d);
}catch(e){if(err)err.textContent=e.message||String(e);} }catch(e){if(err)err.textContent=e.message||String(e);}
} }
@@ -759,5 +759,5 @@
if(id)load(id); if(id)load(id);
// Required member profile (username + verified email). No-ops for a visitor who // 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. // 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){}
})(); })();
+6 -2
View File
@@ -164,11 +164,15 @@
// Resolves once the profile is complete. Safe to call repeatedly: it returns // 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 // 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). // who has not proved they own the position.
async function require_() { // 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'); } try { state = await api('/api/public/profile'); }
catch (e) { return null; } catch (e) { return null; }
if (!state || state.signedIn === false) return null; // a visitor on a shared link: never gate 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 (state.profile && state.profile.complete) return state.profile;
if (back) return null; // already open if (back) return null; // already open
shell(); shell();