Custom Authentication Method in Custom Model 3 Rails

Can I create my own authentication method that accepts a username, password, and other user attribute?

So I could do User.authenticate ('user123', 'secret123', 'attr1')

+4
source share
1 answer
# config/initializers/devise.rb: config.authentication_keys = [ :username, :attr1 ] 

It should be:)

You can learn more about the wiki .

+3
source

Source: https://habr.com/ru/post/1345910/


All Articles