Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9219691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:10:24+00:00 2026-06-18T03:10:24+00:00

Devise is a fantastic gem available for basic or omniauth authentication sign_up and other

  • 0

Devise is a fantastic gem available for basic or omniauth authentication sign_up and other things like sessions maintenance, resend confirmation password etc .

But is it possible using devise to map multiple email addresses to same user ?

Like I have 3,4 email ids such as

  1. sahil@abc.com
  2. sahil@xyz.com
  3. sahil@mno.com

Use Case and Example

I have already registered with my first email id i.e. sahil@abc.com using an automated system and account is created. But i always prefer to use my other email_id i.e. sahil@xyz.com. So, i want to build a system where user can login using any one of the above email adresses with the same/different password. But there should be one single account for the user.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T03:10:25+00:00Added an answer on June 18, 2026 at 3:10 am

    Here is what i exactly needed RoR Devise: Sign in with username OR email

      def self.find_for_database_authentication(conditions={})
        (self.find_by_email(conditions[:email])) || (AuthorizedEmail.confirmed.find_by_email(conditions[:email]).user if AuthorizedEmail.confirmed.find_by_email(conditions[:email]).present?)
      end
    

    What it does is :

    1. Firstly tries to find the user record for authentication by searching with email id.
    2. If it gets the record it returns the record else we go to next part.
    3. It finds in the authorised emails table if there exists any validated and confirmed email in the table. If there is such an entry, it tries to find the user related to that particular authorised email and returns that.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm and usings devise for my authentication and would like to keep the details
Devise, the authentication gem for Ruby based on Warden (another auth gem) does not
I'm using Devise for my User model and sessions control. I'd like to use
Devise Authentication gem ( http://github.com/plataformatec/devise ) is a Rails tool to authenticate a user
I'm using Devise for user authentication and basic authentication. Let's say I have defined
I used devise and omniauth-facebook in my Rails 3 app for Facebook authentication, based
Devise authentication - what is the default behaviour of this gem? I mean: Should
I'm using devise 2.1.0. On dev, things are great. I just tried doing a
Using devise for authentication, undefined method 'size' for nil:NilClass is raised from the following
Using Devise Gem in my project and does anybody know how to redirect user

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.