File tree 1 file changed +13
-1
lines changed 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,19 @@ class DropboxOauth2 < OmniAuth::Strategies::OAuth2
25
25
end
26
26
27
27
def raw_info
28
- @raw_info ||= MultiJson . decode ( access_token . get ( '/2/users/get_current_account' ) . body )
28
+ conn = Faraday . new ( :url => 'https://api.dropbox.com' ) do |faraday |
29
+ faraday . request :url_encoded # form-encode POST params
30
+ faraday . response :logger # log requests to STDOUT
31
+ faraday . adapter Faraday . default_adapter # make requests with Net::HTTP
32
+ end
33
+ response = conn . post do |req |
34
+ req . url '/2/users/get_current_account'
35
+ req . headers [ 'Content-Type' ] = 'application/json'
36
+ req . headers [ 'Authorization' ] = "Bearer #{ access_token . token } "
37
+ req . body = "null"
38
+ end
39
+ @raw_info ||= MultiJson . decode ( response . body )
40
+ # @raw_info ||= MultiJson.decode(access_token.get('/2/users/get_current_account').body)
29
41
end
30
42
31
43
def callback_url
You can’t perform that action at this time.
0 commit comments