Skip to content

Commit f5e7f38

Browse files
Merge pull request #155 from maurobonfietti/v2.24
Version 2.24
2 parents d920451 + 9f55f37 commit f5e7f38

File tree

6 files changed

+21
-14
lines changed

6 files changed

+21
-14
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ DB_PASS=''
55
DB_PORT='3306'
66

77
DISPLAY_ERROR_DETAILS=true
8-
APP_DOMAIN='https://www.yourdomain.com'
8+
APP_DOMAIN='https://example.com'
99
SECRET_KEY='YourSuperSecret-KeY'
1010

1111
REDIS_ENABLED=false

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"require": {
2626
"php": "^8.0",
2727
"composer/composer": "^2.0",
28-
"firebase/php-jwt": "^5.0",
28+
"firebase/php-jwt": "^6.0",
2929
"palanik/corsslim": "dev-slim3",
3030
"predis/predis": "^1.1",
3131
"respect/validation": "^1.1",

composer.lock

Lines changed: 15 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Controller/DefaultController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
final class DefaultController extends BaseController
1111
{
12-
private const API_VERSION = '2.23.0';
12+
private const API_VERSION = '2.24.0';
1313

1414
public function getHelp(Request $request, Response $response): Response
1515
{

src/Middleware/Base.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66

77
use App\Exception\Auth;
88
use Firebase\JWT\JWT;
9+
use Firebase\JWT\Key;
910

1011
abstract class Base
1112
{
1213
protected function checkToken(string $token): object
1314
{
1415
try {
15-
return JWT::decode($token, $_SERVER['SECRET_KEY'], ['HS256']);
16+
return JWT::decode($token, new Key($_SERVER['SECRET_KEY'], 'HS256'));
1617
} catch (\UnexpectedValueException) {
1718
throw new Auth('Forbidden: you are not authorized.', 403);
1819
}

src/Service/User/Login.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ public function login(array $input): string
3030
'exp' => time() + (7 * 24 * 60 * 60),
3131
];
3232

33-
return JWT::encode($token, $_SERVER['SECRET_KEY']);
33+
return JWT::encode($token, $_SERVER['SECRET_KEY'], 'HS256');
3434
}
3535
}

0 commit comments

Comments
 (0)