Good way to add default data to user record (Mongo)? #5033
Unanswered
dasveloper
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When a user signs up I want to run some logic and add some default data. For example a default organization ID, add a Stripe customerID, mark them as being on a free tier limit, etc.
I'm using Mongo so it doesn't have a schema with defaults, and that wouldn't help with logic like creating Stripe IDs anyway.
The only option I see is tying into the isNewUser attribute and running the logic there, but my worry is if something goes wrong the account will be created anyway and they wont have the necessary data.
Is there a better place to run this logic and add this default data and fail out of creating the User if something goes wrong?
Beta Was this translation helpful? Give feedback.
All reactions