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

How to implement username as provider? #1066

Open
KelseyDH opened this issue Jan 16, 2018 · 2 comments
Open

How to implement username as provider? #1066

KelseyDH opened this issue Jan 16, 2018 · 2 comments
Assignees

Comments

@KelseyDH
Copy link

KelseyDH commented Jan 16, 2018

I would like to implement a custom devise strategy where my User's provider is 'username', with a custom username field and recovery_email field along with it, validated in my User model, to ensure I can still log in for this user.

I had an implementation with this behaviour and validations all setup in my User model, however, in multiple places devise_token_auth overrides my User model to force a provider = 'email' even when I explicitly do not want it to.

I've seen other issues describing this matter, but nothing concrete about how to go about doing it.

Most ideal would be for the solution for username/email logins to echo closely with what's recommended in the devise guide How to: Allow users to sign in using their username or email address.

@zachfeldman
Copy link
Contributor

Hey @KelseyDH , as @MaicolBen mentioned I think the pending PR for multi-auth methods per resource may help with this. Feel free to get in touch with the people working on it if you want to help move it forward! I've handed off the baton to those who are going after the bounty.

@KelseyDH
Copy link
Author

Thank you @zachfeldman , I've reached out. When I can get this flow working for username I can write a guide on how to do it and add it to this project's documentation.

@MaicolBen MaicolBen self-assigned this Aug 1, 2019
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