fail closed

This commit is contained in:
Vikhyath Mondreti
2026-02-02 09:29:27 -08:00
parent 334faa17a7
commit 9c5fbbedde

View File

@@ -28,6 +28,8 @@ export { getHighestPrioritySubscription }
/**
* Check if a referenceId (user ID or org ID) has an active subscription
* Used for duplicate subscription prevention
*
* Fails closed: returns true on error to prevent duplicate creation
*/
export async function hasActiveSubscription(referenceId: string): Promise<boolean> {
try {
@@ -40,7 +42,8 @@ export async function hasActiveSubscription(referenceId: string): Promise<boolea
return !!activeSub
} catch (error) {
logger.error('Error checking active subscription', { error, referenceId })
return false
// Fail closed: assume subscription exists to prevent duplicate creation
return true
}
}