gate: fix password_reset RLS policy for crm_auth, set tenant context before token creation
This commit is contained in:
@@ -240,6 +240,10 @@ class AuthService:
|
||||
for prev_token in prev_result.scalars().all():
|
||||
prev_token.used_at = datetime.now(UTC)
|
||||
|
||||
# Set tenant context for RLS (auth session uses crm_auth role)
|
||||
from app.core.db import set_tenant_context
|
||||
await set_tenant_context(db, user_tenant.tenant_id)
|
||||
|
||||
# Create new token
|
||||
import secrets
|
||||
|
||||
|
||||
Reference in New Issue
Block a user