Auth hooks not triggering
Hi everyone! BE engineer dipping my toes in web dev thanks to Wasp. Struggling to implement an OnAfterSignup hook based on the 0.14.0 release instructions, but my hook isn't triggered on signup.
Here's my code:
I then sign up using gmail. Sign up succeeds and I'm logged in, but my hook isn't triggered:
[x] User doesn't exist in the database already - though I'm using the same email address multiple times, could that cause the hook to not be triggered?
[x] Using the different signature shown in the X post
Here's my code:
I then sign up using gmail. Sign up succeeds and I'm logged in, but my hook isn't triggered:
- No "onAfterSignup hook triggered" was logged to the console
- I see a "GET http://localhost:3001/auth/me 401 (Unauthorized)" in the console, which includes a frame "queryFn @ hooks.ts:32" (this is
.wasp/out/sdk/wasp/client/operations/hooks.ts)
[x] User doesn't exist in the database already - though I'm using the same email address multiple times, could that cause the hook to not be triggered?
[x] Using the different signature shown in the X post
- though not sure why the signature is different
[x] Signed up with email/password instead of gmail - same result
[x] I have the correct Wasp version (0.14.0)
Starting with pre and post-signup hooks. They allow you to, e.g.:
- control which emails can register,
- send personalized welcome emails,
- or keep your user data in sync with 3rd party services

7/18/24, 1:37 PM