1
0
Fork 0

Fix error

This commit is contained in:
Alex Kotov 2018-12-04 07:50:38 +05:00
parent 38f12e0b61
commit 5244d0a140
No known key found for this signature in database
GPG Key ID: 4E831250F47DE154
2 changed files with 5 additions and 5 deletions

View File

@ -21,10 +21,10 @@ class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
users = User.where omniauth_provider: auth.provider, omniauth_uid: auth.uid
user = users.first_or_create do |new_user|
new_user.provider = auth.provider
new_user.uid = auth.uid
new_user.email = auth.info.email
new_user.password = Devise.friendly_token[0, 20]
new_user.omniauth_provider = auth.provider
new_user.omniauth_uid = auth.uid
new_user.email = auth.info.email
new_user.password = Devise.friendly_token[0, 20]
end
sign_in_and_redirect user

View File

@ -263,7 +263,7 @@ Devise.setup do |config|
config.omniauth :github,
Rails.application.credentials.github[:client_id],
Rails.application.credentials.github[:client_secret],
scope: 'user,public_repo'
scope: 'user'
# ==> Warden configuration
# If you want to use other strategies, that are not supported by Devise, or