thoughtbot / carnival

An unobtrusive, developer-friendly way to add comments
MIT License
499 stars 30 forks source link

Enforce uniqueness on Email #222

Closed pbrisbin closed 9 years ago

pbrisbin commented 9 years ago

Handle a violation gracefully on sign-up. This prevents users (identified by email) from making multiple accounts through different authentication services.

pbrisbin commented 9 years ago

The return value from authenticate has a UserError AuthMessage constructor that would work well for this: Yesod shows the AuthMessage to the user in the default error page.

Unfortunately, there seems to be no suitable AuthMessage1 at this time (e.g. EmailTaken). We should open a PR upstream to either add EmailTaken, or some more generic mechanism (to AuthMessage or AuthenticationResult) to easily support this use case.

pbrisbin commented 9 years ago

Fixed with 6f617fd and aaa582d