Authenticated user’s email not prefilled in Polar checkout
Hey team — I’m having trouble with the Better Auth + Polar integration.
User flow:
1. A user signs up via Better Auth (email/password or Google).
2. A Polar customer is correctly created with the user’s external_id.
3. A user record is also created in the Better Auth database tables.
4. The user is authenticated and navigates to a pricing page.
5. They click a Subscribe button that calls authClient.checkout({ slug: "pro" }).
6. authenticatedUsersOnly: true is set in the plugin.
The problem: When the authenticated user lands on the Polar checkout page, their email is not prefilled and not locked.
This leads to:
Users being able to enter a different email.
A new Polar customer being created instead of linking to the one from signup.
The checkout session not being tied to the authenticated Better Auth user.
In short, the user context is not being passed into the checkout page.
Other context:
Polar customer is created correctly with the right external ID.
A user record is present in the Better Auth auth tables.
No custom getUser() hook is defined (the docs suggest it isn’t required for checkout).
authClient.checkout({ slug }) is only called once the user is fully authenticated via useSession().data.
Is this a known issue? Does getUser() need to be defined for checkout to work properly, or is the user context expected to be passed automatically by the plugin?
2 Replies
did you ever get a resolution on this @765117 ?
No I actually didn't. In the end, I was really just after quick fix so switched over to using autumn billing and the checkout worked.
The issue was either me making my integration with polar.sh unnecessarily complex or it was a known bug in the plugin.