Skip to content

How to implement username as provider? #1066

Open
@KelseyDH

Description

@KelseyDH

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions