File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414use Laminas \Diactoros \ServerRequestFactory ;
1515use Lcobucci \JWT \Configuration ;
1616use Lcobucci \JWT \UnencryptedToken ;
17+ use OxidEsales \EshopCommunity \Core \Registry ;
1718use OxidEsales \GraphQL \Base \Exception \UnableToParseToken ;
1819use OxidEsales \GraphQL \Base \Service \JwtConfigurationBuilder ;
1920use OxidEsales \GraphQL \Base \Service \TokenValidator ;
@@ -145,6 +146,10 @@ private function getAuthorizationHeader(): ?string
145146 return $ value ;
146147 }
147148
149+ if ($ authCookie = $ this ->getAuthCookie ()) {
150+ return 'Bearer ' . $ authCookie ;
151+ }
152+
148153 if (function_exists ('apache_request_headers ' )) {
149154 $ headers = apache_request_headers ();
150155
@@ -160,6 +165,11 @@ private function getAuthorizationHeader(): ?string
160165 return null ;
161166 }
162167
168+ private function getAuthCookie (): ?string
169+ {
170+ return (string ) Registry::getUtilsServer ()->getOxCookie ('oxapi_jwt ' );
171+ }
172+
163173 private function getRegularHeaderValue (): ?string
164174 {
165175 if (isset ($ _SERVER ['HTTP_AUTHORIZATION ' ])) {
You can’t perform that action at this time.
0 commit comments