File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
apps/web/app/api/settings/billing/subscribe Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -62,11 +62,14 @@ export async function POST(request: NextRequest) {
6262 . where ( eq ( users . id , user . id ) ) ;
6363 customerId = customer . id ;
6464 }
65+
6566 const checkoutSession = await stripe ( ) . checkout . sessions . create ( {
6667 customer : customerId as string ,
6768 line_items : [ { price : priceId , quantity : quantity } ] ,
6869 mode : "subscription" ,
69- success_url : `${ serverEnv ( ) . WEB_URL } /dashboard/caps?upgrade=true&session_id={CHECKOUT_SESSION_ID}` ,
70+ success_url : isOnBoarding
71+ ? `${ serverEnv ( ) . WEB_URL } /dashboard/settings/organization?upgrade=true&session_id={CHECKOUT_SESSION_ID}`
72+ : `${ serverEnv ( ) . WEB_URL } /dashboard/caps?upgrade=true&session_id={CHECKOUT_SESSION_ID}` ,
7073 cancel_url : isOnBoarding
7174 ? `${ serverEnv ( ) . WEB_URL } /onboarding`
7275 : `${ serverEnv ( ) . WEB_URL } /pricing` ,
You can’t perform that action at this time.
0 commit comments