How to use getOAuthState?
I have 1.4.3 version install and it tells me "better-auth/api/middlewares" does not exist
import { getOAuthState } from "better-auth/api"getOAuthState getAuth as a wrapper function, and potentially other important information that I should know.getOAuthState callbackURL, codeVerifier, and more.import { getOAuthState } from "better-auth/api"// client
await betterAuthClient().signIn.social({
provider: "google",
callbackURL,
additionalData: {
signupSource: props.signupSource,
sessionId: posthog.get_session_id(),
locale: locale(),
},
})
// backend
export function getAuth(env: Bindings) {
return betterAuth(env)({
databaseHooks: {
user: {
create: {
before: async (user, ctx) => {
const additionalData = await getOAuthState()
console.log("BEFORE HOOK, oauth header", additionalData) // always nullgetOAuthStategetOAuthStategetAuthcallbackURLcodeVerifier