17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
# File 'app/models/user.rb', line 17
def get_args omniauth
data = omniauth['extra']['raw_info']
case omniauth['privider']
when 'twitter' then
return {
provider: omniauth['provider'], uid: omniauth['uid'],
access_token: omniauth['credentials']['token'],
access_secret: omniauth['credentials']['secret'],
screen_name: data['screen_name'],
bio: data['description'],
image_url: data['profile_image_url'],
web_url: data['url'],
last_tid: nil
}
when 'github' then
return {
provider: omniauth['provider'], uid: omniauth['uid'],
access_token: omniauth['credentials']['token'],
access_secret: omniauth['credentials']['secret'],
screen_name: data['login'],
}
when 'facebook' then
return {
provider: omniauth['provider'], uid: omniauth['uid'],
access_token: omniauth['credentials']['token'],
access_secret: omniauth['credentials']['secret'],
screen_name: data['name'],
}
end
end
|