@@ -51,8 +51,13 @@ public function getOAuthdUrl() {
51
51
*
52
52
*
53
53
*/
54
- public function setOAuthdUrl ($ url ) {
54
+ public function setOAuthdUrl ($ url, $ base = ' /auth ' ) {
55
55
$ this ->injector ->config ['oauthd_url ' ] = $ url ;
56
+ if (strlen ($ base ) > 1 && $ base [0 ] != '/ ' )
57
+ $ base = '/ ' . $ base ;
58
+ if ($ base == '/ ' )
59
+ $ base = '' ;
60
+ $ this ->injector ->config ['oauthd_base ' ] = $ base ;
56
61
}
57
62
58
63
/**
@@ -99,7 +104,7 @@ public function refreshCredentials($credentials, $force = false) {
99
104
$ request = $ this ->injector ->getRequest ();
100
105
$ response = $ request ->make_request (array (
101
106
'method ' => 'POST ' ,
102
- 'url ' => $ this ->injector ->config ['oauthd_url ' ] . ' /auth /refresh_token/ ' . $ credentials ['provider ' ],
107
+ 'url ' => $ this ->injector ->config ['oauthd_url ' ] . $ this -> injector -> config [ ' oauthd_base ' ] . ' /refresh_token/ ' . $ credentials ['provider ' ],
103
108
'body ' => http_build_query (array (
104
109
'token ' => $ credentials ['refresh_token ' ],
105
110
'key ' => $ this ->injector ->config ['app_key ' ],
@@ -130,7 +135,7 @@ public function auth($provider, $options = array()) {
130
135
$ request = $ this ->injector ->getRequest ();
131
136
$ response = $ request ->make_request (array (
132
137
'method ' => 'POST ' ,
133
- 'url ' => $ this ->injector ->config ['oauthd_url ' ] . ' /auth /access_token ' ,
138
+ 'url ' => $ this ->injector ->config ['oauthd_url ' ] . $ this -> injector -> config [ ' oauthd_base ' ] . ' /access_token ' ,
134
139
'body ' => http_build_query (array (
135
140
'code ' => $ options ['code ' ],
136
141
'key ' => $ this ->injector ->config ['app_key ' ],
0 commit comments