feat: add checks for Stripe environment variables in getActiveSubscriptionAction
This commit is contained in:
parent
0b695cc4b2
commit
2b8e0b9cb5
@ -47,6 +47,18 @@ export const getActiveSubscriptionAction = actionClient
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if Stripe environment variables are configured
|
||||||
|
const stripeSecretKey = process.env.STRIPE_SECRET_KEY;
|
||||||
|
const stripeWebhookSecret = process.env.STRIPE_WEBHOOK_SECRET;
|
||||||
|
|
||||||
|
if (!stripeSecretKey || !stripeWebhookSecret) {
|
||||||
|
console.log('Stripe environment variables not configured, return');
|
||||||
|
return {
|
||||||
|
success: true,
|
||||||
|
data: null, // No subscription = free plan
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Find the user's most recent active subscription
|
// Find the user's most recent active subscription
|
||||||
const subscriptions = await getSubscriptions({
|
const subscriptions = await getSubscriptions({
|
||||||
|
Loading…
Reference in New Issue
Block a user