From 334e7ae44921454bbc1543e1f50e02e44a08199a Mon Sep 17 00:00:00 2001
From: Marcela Ribeiro de Oliveira <mro15@inf.ufpr.br>
Date: Tue, 24 Apr 2018 10:37:34 -0300
Subject: [PATCH] open image before assign to user in facebook and google login

---
 app/controllers/v1/omniauth_callbacks_controller.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/controllers/v1/omniauth_callbacks_controller.rb b/app/controllers/v1/omniauth_callbacks_controller.rb
index d64c7ed0..161ca6d2 100644
--- a/app/controllers/v1/omniauth_callbacks_controller.rb
+++ b/app/controllers/v1/omniauth_callbacks_controller.rb
@@ -97,7 +97,7 @@ require 'open-uri'
     # break out provider attribute assignment for easy method extension
     def assign_provider_attrs(user, auth_hash)
 
-      avatar = auth_hash['provider']=='google_oauth2' ? open(auth_hash['info']['image'])  : auth_hash['info']['image'] 
+      avatar = open(auth_hash['info']['image'])
 
       user.assign_attributes({
         nickname: auth_hash['info']['nickname'],
-- 
GitLab