File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,34 +71,35 @@ const resend = emailVerificationEnabled && process.env.RESEND_API_KEY
7171 ? new Resend ( process . env . RESEND_API_KEY )
7272 : null ;
7373
74- const plans = [
75- {
76- name : "saru" ,
77- priceId : process . env . STRIPE_PRO_MONTHLY_PRICE_ID ! ,
78- annualDiscountPriceId : process . env . STRIPE_PRO_YEARLY_PRICE_ID ! ,
79- } ,
80- ] ;
81-
8274type HookUser = {
8375 id : string ;
8476 email ?: string | null ;
8577} ;
8678
8779const authPlugins : any [ ] = [ ] ;
8880
89- authPlugins . push (
90- stripe ( {
91- stripeClient : stripeClient ! ,
92- stripeWebhookSecret : process . env . STRIPE_WEBHOOK_SECRET ! ,
93- createCustomerOnSignUp : true ,
94- subscription : {
95- enabled : stripeEnabled ,
96- plans,
97- requireEmailVerification : emailVerificationEnabled ,
81+ if ( stripeEnabled ) {
82+ const plans = [
83+ {
84+ name : "saru" ,
85+ priceId : process . env . STRIPE_PRO_MONTHLY_PRICE_ID ! ,
86+ annualDiscountPriceId : process . env . STRIPE_PRO_YEARLY_PRICE_ID ! ,
9887 } ,
99- } )
100- ) ;
101-
88+ ] ;
89+
90+ authPlugins . push (
91+ stripe ( {
92+ stripeClient : stripeClient ! ,
93+ stripeWebhookSecret : process . env . STRIPE_WEBHOOK_SECRET ! ,
94+ createCustomerOnSignUp : true ,
95+ subscription : {
96+ enabled : stripeEnabled ,
97+ plans,
98+ requireEmailVerification : emailVerificationEnabled ,
99+ } ,
100+ } )
101+ ) ;
102+ }
102103
103104authPlugins . push ( nextCookies ( ) ) ;
104105
You can’t perform that action at this time.
0 commit comments