-
Notifications
You must be signed in to change notification settings - Fork 9
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
Repeated responses for email already taken #108
Comments
This may be a silly question, but was the email address already used to create an account prior to seeing the error? Looking at the issue on Bernie-2016/fieldthebern-android#288, it seems you may have already signed up with [email protected] before? If that’s the case, then the API response is correct, as email addresses must be unique for each user. |
The issue I think is that the API returns an error with the message repeated twice (or title/message are the same or something like that). So to the user sees something like this in a single dialog box/message:
It's just that the error message looks silly, but the API did behave correctly. |
Aha! Thanks so much for the clarification, I’m able to reproduce it. PR on its way. |
A uniqueness validation for the user `email` attribute has already been added by the `Clearance::User::Validations` module in [clearance/user.rb#L144-L148](https://github.com/thoughtbot/clearance/bl ob/3e9529a643cff20beb9bb49eacedb90dee49d465/lib/clearance/user.rb#L144-L 148). Duplicating the validation rule was resulting in duplicate error responses from the API. In addition, there is no need to specify a `case_sensitive` property for the uniqueness validation on _non-text_ columns (the email column type is `varchar`), as it is ignored. This update removes the redundant uniqueness validation for `user#email`, therefore preventing multiple email validation errors that were occurring in API responses. Closes Bernie-2016#108
Per @patrickcousins the API is returning "Email is already taken" repeatedly. Previously filed on Android, Bernie-2016/fieldthebern-android#288.
The text was updated successfully, but these errors were encountered: