chris
chris
BABetter Auth
Created by chris on 2/20/2025 in #help
loging the stack; "payload" argument must be of type object.
I am unable to register new users with my better auth/prisma NextJS app. When a user submits valid credentials, I get this error:
2025-02-20T20:33:11.442Z ERROR [Better Auth]: TypeError [TypeError: The "payload" argument must be of type object. Received null] {
code: 'ERR_INVALID_ARG_TYPE'
}
2025-02-20T20:33:11.442Z ERROR [Better Auth]: TypeError [TypeError: The "payload" argument must be of type object. Received null] {
code: 'ERR_INVALID_ARG_TYPE'
}
Ideally we would have access to log the error .stack, is there a way to do this ?
15 replies
BABetter Auth
Created by chris on 1/23/2025 in #help
What is the Better Auth equivalent to the Next Auth Callbacks?
in next auth if we wanted to control what happens when an action is performed, like sign in, we used a callback in the auth config. what is the equivalent in better auth?
3 replies
BABetter Auth
Created by chris on 1/22/2025 in #help
how to have protected social login (whitelisted emails)
My nextjs/prisma/better-auth app lets the app admin whitelist emails for who can register/login. The apps login page has google login via better-auth. Better-auth "Before hooks" can NOT know the email via ctx.body.email so i cant use before hooks to check for whitelisted emails, and yet if i use after hooks the user is already created in the db. i could just delte the user from the db after getting their email, but ideally better-auth had hook for /sign-in/social after we know the EMAIL, but before the user is written to the DB.
14 replies