diff --git a/app/controllers/v1/omniauth_callbacks_controller.rb b/app/controllers/v1/omniauth_callbacks_controller.rb index a2edc1e4a769bf2deba4bf3fa2658d0e0ab4f5fa..54854b7cfb3ece484680ee764259ea0d5d7e13cd 100644 --- a/app/controllers/v1/omniauth_callbacks_controller.rb +++ b/app/controllers/v1/omniauth_callbacks_controller.rb @@ -1,3 +1,4 @@ +require 'open-uri' class V1::OmniauthCallbacksController < DeviseTokenAuth::ApplicationController attr_reader :auth_params @@ -76,8 +77,7 @@ # break out provider attribute assignment for easy method extension def assign_provider_attrs(user, auth_hash) - avatar = auth_hash['provider']=='google_oauth2' ? "" : auth_hash['info']['image'] - + avatar = auth_hash['provider']=='google_oauth2' ? open(auth_hash['info']['image']) : auth_hash['info']['image'] user.assign_attributes({ nickname: auth_hash['info']['nickname'],