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
+6 -2
View File
@@ -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();