File tree Expand file tree Collapse file tree 1 file changed +14
-12
lines changed
Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -25,20 +25,22 @@ public function __construct(IntrospectClient $client, Request $request)
2525
2626 protected function getIntrospectionResult ()
2727 {
28- if ($ this ->result === null ) {
29- try {
30- $ this ->result = $ this ->client ->introspect ($ this ->request ->bearerToken ());
31- } catch (RequestException $ e ) {
32- if ($ e ->hasResponse ()) {
33- $ result = json_decode ((string ) $ e ->getResponse ()->getBody (), true );
34-
35- if (isset ($ result ['error ' ])) {
36- throw new AuthenticationException ($ result ['error ' ]['title ' ] ?? '' );
37- }
38- }
28+ if ($ this ->result !== null ) {
29+ return $ this ->result ;
30+ }
31+
32+ try {
33+ $ this ->result = $ this ->client ->introspect ($ this ->request ->bearerToken ());
34+ } catch (RequestException $ e ) {
35+ if ($ e ->hasResponse ()) {
36+ $ result = json_decode ((string ) $ e ->getResponse ()->getBody (), true );
3937
40- throw new AuthenticationException ($ e ->getMessage ());
38+ if (isset ($ result ['error ' ])) {
39+ throw new AuthenticationException ($ result ['error ' ]['title ' ] ?? '' );
40+ }
4141 }
42+
43+ throw new AuthenticationException ($ e ->getMessage ());
4244 }
4345
4446 return $ this ->result ;
You can’t perform that action at this time.
0 commit comments