gitgy
gitgy
KKinde
Created by gitgy on 10/15/2024 in #💻┃support
Stripe success_url from checkout session logs user out.
const session = await stripeClient.checkout.sessions.create({ success_url: `https://mydomain.com/restoflink and https://mydomain-staging.com/restoflink Hello, when my application gets redirected to the success_url on staging, the user is still logged in (cookies are still set, etc) and correctly redirects to the success_url. However, on my production url, the user is always logged out and redirected to my home page. Here's the code for the specific page I want to redirect to: const {getPermission, getUser} = getKindeServerSession(); const user = await getUser() const isAdmin = await getPermission("xxxx") if (!user) { redirect('/') } const userExists = await db.query.users.findFirst({ where: (fields) => eq(fields.kindeId, user.id) }); if (!userExists) { redirect('/') } const courseExists = await getCourseBySlug(params.course) if (!courseExists) { return <p className="mx-auto text-center font-extrabold mt-40">Course not found</p>; } if (!courseExists.isPublished && !isAdmin?.isGranted) { redirect('/') }
4 replies