File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,21 +24,18 @@ class ScriptMicroserviceService
2424
2525 private $ tenantChecked = false ;
2626
27- private function client ($ includeToken = true )
27+ private function client ()
2828 {
2929 if (!$ this ->client ) {
3030 $ this ->client = Http::withOptions ([
3131 'verify ' => !App::environment ('local ' ),
3232 ])->baseUrl (config ('script-runner-microservice.base_url ' ))
33+ ->withToken ($ this ->getAccessToken ())
3334 ->accept ('application/json ' )
3435 ->contentType ('application/json ' )
3536 ->throw ();
3637 }
3738
38- if ($ includeToken ) {
39- $ this ->client ->withToken ($ this ->getAccessToken ());
40- }
41-
4239 return $ this ->client ;
4340 }
4441
@@ -151,7 +148,7 @@ public function getAccessToken()
151148 return Cache::get ('keycloak.access_token ' );
152149 }
153150
154- $ response = $ this -> client ( false )-> asForm ()->post (config ('script-runner-microservice.keycloak.base_url ' ) ?? '' , [
151+ $ response = Http:: asForm ()->post (config ('script-runner-microservice.keycloak.base_url ' ) ?? '' , [
155152 'grant_type ' => 'password ' ,
156153 'client_id ' => config ('script-runner-microservice.keycloak.client_id ' ),
157154 'client_secret ' => config ('script-runner-microservice.keycloak.client_secret ' ),
You can’t perform that action at this time.
0 commit comments