Skip to content
Snippets Groups Projects
Commit a02a5004 authored by Marcela Ribeiro de Oliveira's avatar Marcela Ribeiro de Oliveira
Browse files

Merge branch 'google-image-login' into 'master'

Google image login

See merge request !361
parents 3a92a700 88a440af
No related branches found
No related tags found
No related merge requests found
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'],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment