Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Don't save user to DB when a custom field is invalid #7513

Conversation

Darkneon
Copy link
Contributor

@RocketChat/core

To avoid a huge PR, this is the first PR of a series to fix issues with registration. This one deals with the API.

The problem is Accounts.createUser gets called before the customFields are validated and it inserts the user into the DB. Correcting the customFields and trying to create the user again will fail with email already exists. The same issue is present in the UI (I have another PR for it)

Due to a limitation in Mocha, as described here https://demo.rocket.chat/channel/dev?msg=gHB4Gj2P9gN7zCm4c, the it are wrapped with describe. I think it's a good restructure as it will make adding fail cases easier in the future.

@rodrigok rodrigok added this to the 0.58.0 milestone Jul 27, 2017
@rodrigok rodrigok merged commit fc8d0e8 into RocketChat:develop Jul 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants