Devise Omniauth “encrypted_password may not be NULL” for new user

前端 未结 1 806
后悔当初
后悔当初 2021-02-04 15:13

I am using Devise with Omniauth to have users sign into my app with Facebook. I used the Railscast tutorials to get it up and running.

If a user is already a member of

相关标签:
1条回答
  • 2021-02-04 15:53

    Add :password => Devise.friendly_token[0,20] when creating a new user from facebook omniauth.

    I believe Devise is expecting something in the password field to create a User. Since there is no password when doing facebook oauth (not on your app side at least), you just need to create a dummy password as show above.

    See this for more info: https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview

    0 讨论(0)
提交回复
热议问题