Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I want to use a different column for provider instead of defalut "email" #485

Closed
prakash-alpine opened this issue Dec 23, 2015 · 2 comments

Comments

@prakash-alpine
Copy link

I am running into a problem using "email" as a provider in my User table. I am using the
symmetric_encryption gem to encrypt the email column in my postgres database. This requires to change the name of "email" column to "encrypted_email". Also I am using "username" and "password" as login credentials with Devise instead of "email / password".

With standard Devise gem everything works fine and I am able to login using regular HTML version of login page. However, I can not get the authentication to work with devise_token_auth, since it insists of
using "email" as provider.

My question is: Is there any way I can use a different column (e.g. username) as a provider instead of
default "email" ? I browsed through the code, and it seems that "email" is hard-coded as a provider in session_controller.rb->create() method.

Please help !!!

@campo
Copy link

campo commented Mar 10, 2016

This is similar and related to: #563 (comment)

My comment there has some information that might be able to help you get the sign in working, but it would be a hacky solution. I suspect it would require your email field be named exactly email, and the uid set in the headers in responses would be the value of that field.

@zachfeldman
Copy link
Contributor

Closed in favor of #563

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants