I have a cloud function which should create a new user document as soon as user otp validation completes successfully. But when i create user from appwrite cloud , it seems to add that document and when i add a user from my app , the event doesnt trigger. Problem 1 = Function not executed as event not triggering Problem 2 = How to create a document only when user validates/verifies otp successfully.
Use users.*.verification.*update to trigger the function when the as soon as the user otp validation successfully completes. It's the last part in this section of the documentation https://appwrite.io/docs/events
there is no users.*.verification.*update option in appwrite cloud
Hi - are you using the private cloud beta? just to confirm
yes
How to create a document only when user validates/verifies otp successfully
Would you please clarify what you're looking for? Do you want the function to execute on https://appwrite.io/docs/client/account?sdk=web-default#accountUpdatePhoneSession or https://appwrite.io/docs/client/account?sdk=web-default#accountUpdatePhoneVerification?
update phone verification
basically i need to create an user document when the user successfully logs in first time in our application
it should not trigger for sessions as it will be many times for a particular user.
@Steven can u please let me know what is the best way to this simple step.
I suggest triggering on session creation but you can do some logic to make sure the rest of your function only executes once for the user
ok sir.. but this should be fixed as that would be regular requirement for all. Or basically we can provide (enable) a simple option in settings/cli to create a user document in a user named collection whenever a user is done verified in auth user.
Thanks btw for saving my time again
Happy to help!
Recommended threads
- Function connected custom domain error: ...
My domain is served through Cloudflare. Domain is now connected with the appwrite function. But when accessing the domain, I get the below error. Any suggestion...
- Error | general_unknown
I have built a website using Appwrite Cloud as backend, and also using sites for deployment. My website is live but sometimes it shows Appwrite's Error general_...
- functions domain error
I cannot set up the domain for function I’m trying to add the domain api.example.com I can only use Cloudflare as the DNS provider because my domain provider do...