Hello, I am having an issue in which for some reason I cannot get the authenticated user in a library function in my app. I have a function stripeDBSync() that is at /src/lib/stripe/stripe-sync.ts. The main purpose of it is to query stripe's API and update my DB with the newest stripe data for a customer. The problem I am facing is that for some reason, even though the user is logged in (There is no way to also trigger that from an unprotected route) when I do:
const supabase = await createClient(); const { data } = await supabase.auth.getClaims(); console.log(data)
data prints out as null. On every other page this call gives me the auth user. Any ideas?
The user is experiencing an issue where the authenticated user data is not being retrieved in a library function. Despite being logged in, the getClaims() call returns null in the stripeDBSync() function, which is intended to sync data with Stripe's API.