After Hook
I am currently trying to send a registration email, and for that, I am using the after hook, following the documentation and example from Better Auth:
Better Auth Hooks Documentation.
This is my current code:
Additionally, I have the middleware configured as follows:
However, the console.log statements in the authentication middleware show the following output:
Middleware executed in : /sign-in/social
POST /api/auth/sign-in/social 200 in 70ms
Middleware executed in : /callback/:id
GET /api/auth/callback/google?... 302 in 210ms
Middleware executed in : /get-session
GET / 200 in 415ms
Middleware executed in : /get-session
GET /api/auth/get-session 200 in 64ms
Is there something I might be overlooking that could be causing this behavior? I would really appreciate any help.
3 Replies
you should use a database hook instead
/sign-in/social
doesn't register the user yet. It just generates the authorization urlThanks, I try solve this
I finish xd
