Configure Devise Allow Same Email For Multiple Accounts

故事扮演 提交于 2020-02-02 10:12:12

问题


We have users that want to use the same email address for multiple accounts. Our rails app uses omniauth-twitter gem with Devise to authenticate users. When users sign up, email is required but it is not used for authentication.

How do we configure Devise to allow users to use same email when signing up for multiple accounts without getting "email has already been taken" validation error?


回答1:


You can simply remove :validatable from the model devise options.

Validatable creates all needed validations for a user email and password. It's optional, given you may want to create the validations by yourself. Automatically validate if the email is present, unique and its format is valid. Also tests presence of password, confirmation and length.

http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Validatable



来源:https://stackoverflow.com/questions/24250143/configure-devise-allow-same-email-for-multiple-accounts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!