Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Email uniqueness with scope and forgot password #1739

cedricbousmanne opened this Issue · 4 comments

3 participants



I run into an issue with Devise 2.0.4.

I want my user email's to be unique depending on an account_id, so i setup my initializer this way :

config.authentication_keys = [ :email, :account_id ]

After having fix my login form, everything seems to be OK.

But when i try to retrieve a lost password for a user whom email address has been used more than once, Devise seem to take only the first user matching the email address, without asking for the account_id - even if i provided it as a parameter.

Thank you


If I am not wrong, there are also reset_password_keys available for configuration, could you please check?


You're right. Thank you for your answer and sorry not to have completely read the configuration file before asking ;-)


That's fine. :)


I have a scenario where i want the users to have multiple logins with same email address and provider. So my user model has email and provider and i want to scope the email based on provider. I tried config.authentication_keys = [ :email, :provider ] but it didn't work. Do i need to have a separate model in order for this to work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.