DEV Community

Discussion on: Creating and updating users with omniauth

Collapse
 
honzasterba profile image
Honza Štěrba

You should only update the fields that are necessary, in the scenario when the user has signed up using facebook and later also configured a password you will throw the password away by using this code and it could lead to some confused users having to reset their password for no reason.

Collapse
 
rodreegez profile image
Adam Rogers

Absolutely. If your app supports logging into a single account from multiple providers you’re gonna have a bad time using this implementation.

Collapse
 
oyenmwen profile image
Osayimwen Odia

a possible workaround could be:

unless user.password.present?
    user.password = Devise.friendly_token[0, 20]
end
Enter fullscreen mode Exit fullscreen mode