Extending verifyEmail function
Hi, is it possible at all to extend some of the Auth functions? E.g verifyEmail, signup, etc..
I’m looking to add some additional logic after user has verified their email.
I know I can create my custom verifyEmail component, however I don’t want to expose out a new Action that is visible to the user.
Is there anything I can do on the server?
4 Replies
Hi @crunchyTaco. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Yes, it is possible to extend the Auth functions in Wasp. You can create a custom sign-up action where you can add your additional logic after the user has verified their email.
Here is an example of how you can create a custom sign-up action:
You can add your custom code after the sign-up action. However, please note that this will expose a new action that is visible to the user.
For more information, you can refer to the Wasp documentation (https://wasp-lang.dev/docs/auth/email#creating-a-custom-sign-up-action).
In the future, Wasp plans to add hooks where you will be able to run code after/before signup/login. This feature is expected to be released in the next 1-2 months according to a Discord support thread (https://discord.com/channels/686873244791210014/1217452914503585902).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @crunchyTaco, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?
Hey, we are releasing auth hooks soon with Wasp 0.14.0 which would enable you to run code
onBeforeSignup
, onAfterSignup
and onBeforeOAuthRedirect
. Here's the PR: https://github.com/wasp-lang/wasp/pull/1993
Would that solve your issue?
Outside of using the auth hooks, you'd have to write your own custom signup function.
Also, regarding customisation of signup data validation, we have it planned here: https://github.com/wasp-lang/wasp/issues/1571@miho that’s exactly what I am looking for! Is there a concrete date on when 0.14 will be released?
Can't make any promises, but soon 🙃