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

Using OmniAuth without other authentications throws undefined method password #4334

Closed
DEfusion opened this issue Oct 20, 2016 · 1 comment
Closed

Comments

@DEfusion
Copy link

I followed the instructions here: https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview#using-omniauth-without-other-authentications

I removed :database_authenticatable from my User class and then I get an error saying undefined method 'password' on the first_or_create call.

def self.from_omniauth(auth)
    where(provider: auth.provider, uid: auth.uid).first_or_create do |user|
     user.email = auth.info.email
     user.name = auth.info.name
    end
  end

If I don't do those things everything works as expected.

@evertonts
Copy link

Please use the mailing list or StackOverflow for questions/help, where a wider community will be able to help you. We reserve the issues tracker for issues only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants