Welcome to the Kinde community.

P
K
A
A
A
Members
gitgy
g
gitgy
Offline, last seen yesterday
Joined September 23, 2024
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('/')
}
2 comments
g
I
Hello! When npm run build executes, it logs the error from my helper function yet it still builds successfully. I am assuming this is because it's only generating static pages so it can't fetch data. Is it okay to ignore these errors? If not, what is the correct way to handle this? Thanks!
4 comments
D
g
P