File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed
app/code/Magento/Webapi/Model/Authorization Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -94,44 +94,38 @@ public function getUserType() //phpcs:ignore CopyPaste
94
94
*
95
95
* @return void
96
96
*/
97
- protected function processRequest () //phpcs:ignore CopyPaste
97
+ private function processRequest () //phpcs:ignore CopyPaste
98
98
{
99
99
if ($ this ->isRequestProcessed ) {
100
100
return ;
101
101
}
102
-
103
102
$ authorizationHeaderValue = $ this ->request ->getHeader ('Authorization ' );
104
103
if (!$ authorizationHeaderValue ) {
105
104
$ this ->isRequestProcessed = true ;
106
105
return ;
107
106
}
108
-
109
107
$ headerPieces = explode (" " , $ authorizationHeaderValue );
110
108
if (count ($ headerPieces ) !== 2 ) {
111
109
$ this ->isRequestProcessed = true ;
112
110
return ;
113
111
}
114
-
115
112
$ tokenType = strtolower ($ headerPieces [0 ]);
116
113
if ($ tokenType !== 'bearer ' ) {
117
114
$ this ->isRequestProcessed = true ;
118
115
return ;
119
116
}
120
-
121
117
$ bearerToken = $ headerPieces [1 ];
118
+
122
119
/** @var Token $token */
123
120
$ token = $ this ->tokenFactory ->create ()->load ($ bearerToken , 'token ' );
124
-
125
121
if (!$ token ->getId () || $ token ->getRevoked ()) {
126
122
$ this ->isRequestProcessed = true ;
127
-
128
123
return ;
129
124
}
130
125
if (((int ) $ token ->getUserType ()) === UserContextInterface::USER_TYPE_INTEGRATION ) {
131
126
$ this ->userId = $ this ->integrationService ->findByConsumerId ($ token ->getConsumerId ())->getId ();
132
127
$ this ->userType = UserContextInterface::USER_TYPE_INTEGRATION ;
133
128
}
134
-
135
129
$ this ->isRequestProcessed = true ;
136
130
}
137
131
}
You can’t perform that action at this time.
0 commit comments