File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -108,22 +108,23 @@ public function auth($provider, $options = array()) {
108
108
'method ' => 'POST ' ,
109
109
'url ' => $ this ->injector ->config ['oauthd_url ' ] . '/auth/access_token ' ,
110
110
'body ' => http_build_query (array (
111
- 'code ' => $ code ,
111
+ 'code ' => $ options [ ' code ' ] ,
112
112
'key ' => $ this ->injector ->config ['app_key ' ],
113
113
'secret ' => $ this ->injector ->config ['app_secret ' ]
114
114
)) ,
115
115
'headers ' => array (
116
116
'Content-Type ' => 'application/x-www-form-urlencoded '
117
117
)
118
118
));
119
- $ credentials = $ response ->body ;
120
- if (isset ($ credentials ->provider )) {
121
- $ this ->injector ->session ['oauthio ' ]['auth ' ][$ credentials ->provider ] = json_decode (json_encode ($ credentials ) , true );
119
+ $ credentials = json_decode (json_encode ($ response ->body ), true );
120
+
121
+ if (isset ($ credentials ['provider ' ])) {
122
+ $ this ->injector ->session ['oauthio ' ]['auth ' ][$ credentials ['provider ' ]] = $ credentials ;
122
123
}
123
124
} else if (isset ($ options ['credentials ' ])) {
124
125
$ credentials = $ options ['credentials ' ];
125
126
} else {
126
- $ credentials = $ this ->injector ->session ['oauthio ' ]['auth ' ][' provider ' ];
127
+ $ credentials = $ this ->injector ->session ['oauthio ' ]['auth ' ][$ provider ];
127
128
}
128
129
$ credentials = $ this ->refreshCredentials ($ credentials );
129
130
$ request = new Request ($ credentials );
You can’t perform that action at this time.
0 commit comments