14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/tenzing/oauth_extract.rb', line 14
def get_oauth_data
return nil unless @oauth.present?
@oauth_data = {
user: {
email: @oauth.info['email'],
name: @oauth.info['name'],
image: @oauth.info['image'],
},
auth: {
provider: @oauth.provider,
uid: @oauth.uid,
username: @oauth.info['nickname'],
auth_token: @oauth.credentials['token'],
auth_secret: @oauth.credentials['secret'],
expires_at: parse_expiration_date(@oauth),
}
}
raise 'Unable to get OAuth2 data' if @oauth_data.empty?
end
|