chris
BABetter Auth
•Created by chris on 1/22/2025 in #help
how to have protected social login (whitelisted emails)
ah yes! DATABASE HOOKS sound exactly like what i need... sorry @j_slno you linked to the database docs with an anchor to
#before-hook
which seems correct, but in discord, using chrome on mac, when I clicked your link to see what you were trying to suggest, i was taken to the TOP of the page at https://www.better-auth.com/docs/concepts/database and not to your anchored link, and I was not paying attention enough to know i should have scrolled way down the page. (safari this anchor works, but for some reason in chrome it does not). in any case i will try database hooks next. thank you @bekacru and @lonelyplanet for your help too14 replies
BABetter Auth
•Created by chris on 1/22/2025 in #help
how to have protected social login (whitelisted emails)
hi @lonelyplanet @j_slno and @bekacru , no so far I have only been able to use an after hook and delete from the DB any user who is not whitelisted, again because
ctx.body.email
is NOT and can not be present on a social login BEFORE hook, would really like some way to hook into better auth cycle AFTER we know the email from social login and BEFORE the user is created. any other ideas?14 replies
BABetter Auth
•Created by chris on 1/22/2025 in #help
how to have protected social login (whitelisted emails)
@bekacru trying this now, and i see there is no
ctx.body.email
on social sign-in before hook, which makes sense because presumably we would not know the users email until they come back from the social provider, since this app is invite only, I would rather not let better-auth create the user in the DB, only for me to review the whitelisted emails, and then remove any user who is not whitelisted. Ideally there was some better-auth hook, for before a user is created in the db but after we know their email from social login, is there a hook for that or a solution that comes to mind?14 replies
BABetter Auth
•Created by chris on 2/20/2025 in #help
loging the stack; "payload" argument must be of type object.
i'll dive deeper..
15 replies
BABetter Auth
•Created by chris on 2/20/2025 in #help
loging the stack; "payload" argument must be of type object.
15 replies
BABetter Auth
•Created by chris on 2/20/2025 in #help
loging the stack; "payload" argument must be of type object.
options..
15 replies
BABetter Auth
•Created by chris on 2/20/2025 in #help
loging the stack; "payload" argument must be of type object.
This pattern is basically required to debug Prism apps. How can I configure better auth to log the error stack in these cases so I can see the necessary information
@bekacru
15 replies
BABetter Auth
•Created by chris on 2/20/2025 in #help
loging the stack; "payload" argument must be of type object.
15 replies
BABetter Auth
•Created by chris on 2/20/2025 in #help
loging the stack; "payload" argument must be of type object.
just thinking out loud here.. When I work with prisma directly, I can get better errors by logging the error stack
15 replies
BABetter Auth
•Created by chris on 2/20/2025 in #help
loging the stack; "payload" argument must be of type object.
but i understand how that might not be possible, some sort of onError function for the server side
15 replies
BABetter Auth
•Created by chris on 2/20/2025 in #help
loging the stack; "payload" argument must be of type object.
right, that is what i have been doing. it just bit me more than a few times, and a better error would be nice (for example so i know what schema is not correct) @bekacru
15 replies
BABetter Auth
•Created by chris on 1/22/2025 in #help
how to have protected social login (whitelisted emails)
Hi @Liltripple_reid yes, i alrady do that on the client side. the question is about the server side, and the more i code this the more i have questions about how to do it in better-auth vs what i would previously do in next-auth, for example in next auth we have callbacks in the authOptions and i would use that to check the siginin to ensure the user was whitelisted. i just dont know how (yet) to do that in better-auth
14 replies
BABetter Auth
•Created by chris on 1/22/2025 in #help
how to have protected social login (whitelisted emails)
@bekacru any idea?
14 replies