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:
2026-05-23 22:45:57 +02:00
parent 212d3650f5
commit 8587ec372f
2 changed files with 7 additions and 2 deletions
+1
View File
@@ -50,6 +50,7 @@ window.DBN_TOOLS_AUTHENTICATED = <?= $layoutIsGuest ? 'false' : 'true' ?>;
window.DBN_TOOLS_LANG = <?= json_encode($uiLang, JSON_UNESCAPED_UNICODE) ?>;
<?php if ($layoutFreeTierBalance >= 0): ?>
window.DBN_FREE_TIER_BALANCE = <?= $layoutFreeTierBalance ?>;
window.DBN_USER_TIER = <?= json_encode(FreeTier::tier((int)$_SESSION['dbn_tools_sso_uid'])) ?>;
<?php endif; ?>
</script>
<?php if (date('m-d') === '05-17'): ?>