jwtbutler 1.7.5 → 1.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -212,8 +212,14 @@ if (@$_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
|
|
|
212
212
|
}
|
|
213
213
|
|
|
214
214
|
try {
|
|
215
|
+
$token = null;
|
|
216
|
+
if ($_SERVER['HTTP_AUTHORIZATION'] ?? '') {
|
|
217
|
+
$token = str_replace('Bearer ', '', $_SERVER['HTTP_AUTHORIZATION']);
|
|
218
|
+
} elseif ($_COOKIE['access_token'] ?? '') {
|
|
219
|
+
$token = str_replace('Bearer ', '', $_COOKIE['access_token']);
|
|
220
|
+
}
|
|
215
221
|
$user_id = JWT::decode(
|
|
216
|
-
|
|
222
|
+
$token, // access token
|
|
217
223
|
new Key('WM38tprPABEgkldbt2yTAgxf2CGstfr5', 'HS256'), // secret key
|
|
218
224
|
)->sub;
|
|
219
225
|
http_response_code(200);
|