fix: expose DBN_USER_TIER so plus/pro SSO users can use doc picker
isPaidUser() was checking DBN_FREE_TIER_BALANCE === undefined, which is only true for CaveauAI sessions. SSO users (even plus/pro) always have DBN_FREE_TIER_BALANCE set, so the picker was showing the upgrade modal for everyone in the SSO flow. Now reads DBN_USER_TIER explicitly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -13,8 +13,12 @@
|
||||
// DBN_FREE_TIER_BALANCE is set only for SSO (free) users.
|
||||
// Paid CaveauAI sessions have it undefined.
|
||||
function isPaidUser() {
|
||||
return window.DBN_TOOLS_AUTHENTICATED === true
|
||||
&& typeof window.DBN_FREE_TIER_BALANCE === 'undefined';
|
||||
if (window.DBN_TOOLS_AUTHENTICATED !== true) return false;
|
||||
// CaveauAI sessions never have DBN_FREE_TIER_BALANCE set
|
||||
if (typeof window.DBN_FREE_TIER_BALANCE === 'undefined') return true;
|
||||
// SSO sessions: check the explicit tier variable
|
||||
var t = window.DBN_USER_TIER;
|
||||
return t === 'plus' || t === 'pro';
|
||||
}
|
||||
|
||||
// ── Upgrade modal ─────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user