Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Email uniqueness with scope and forgot password #1739

Closed
cedricbousmanne opened this Issue · 4 comments

3 participants

@cedricbousmanne

Hi,

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

@josevalim
Owner

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

@cedricbousmanne

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

@josevalim
Owner

That's fine. :)

@mfa213

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.