Grant new users a three-day signup trial

This commit is contained in:
2569718930@qq.com
2026-03-29 20:34:12 +08:00
parent 6139960a9e
commit 2b5d2cd801
4 changed files with 270 additions and 3 deletions
+7 -2
View File
@@ -275,10 +275,15 @@ async def auth_me(request: Request):
if SUPABASE_ENTITLEMENT.enabled and user_id:
try:
latest_subscription = SUPABASE_ENTITLEMENT.get_latest_active_subscription(
latest_subscription = SUPABASE_ENTITLEMENT.ensure_signup_trial(
user_id,
respect_requirement=False,
created_at=getattr(request.state, "auth_created_at", None),
)
if not latest_subscription:
latest_subscription = SUPABASE_ENTITLEMENT.get_latest_active_subscription(
user_id,
respect_requirement=False,
)
if (
not latest_subscription
and getattr(PAYMENT_CHECKOUT, "enabled", False)