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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user