Compare commits

...

2 Commits

Author SHA1 Message Date
c6d33753c8
adapt to new soko-web
All checks were successful
rvr-nextgen/pipeline/pr-master This commit looks good
2023-04-16 16:03:38 +02:00
b32092f1cd
upgrade soko-web to 0.2.1 2023-04-16 16:03:11 +02:00
4 changed files with 9 additions and 10 deletions

View File

@ -10,7 +10,7 @@
} }
], ],
"require": { "require": {
"esoko/soko-web": "0.1", "esoko/soko-web": "0.2.1",
"firebase/php-jwt": "^6.4" "firebase/php-jwt": "^6.4"
}, },
"require-dev": { "require-dev": {

8
composer.lock generated
View File

@ -4,15 +4,15 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "f2dcf297a4a619bc5edfe7b4fac0836e", "content-hash": "695034ad53031c4fdacbc6f551d610e3",
"packages": [ "packages": [
{ {
"name": "esoko/soko-web", "name": "esoko/soko-web",
"version": "v0.1", "version": "v0.2.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://git.esoko.eu/esoko/soko-web.git", "url": "https://git.esoko.eu/esoko/soko-web.git",
"reference": "a17a88e9d44e42cef3d996fc66b4dd1134b85def" "reference": "4af7ae352108e7ba151fca2633ff4b40b3194b32"
}, },
"require": { "require": {
"phpmailer/phpmailer": "^6.8", "phpmailer/phpmailer": "^6.8",
@ -33,7 +33,7 @@
"GNU GPL 3.0" "GNU GPL 3.0"
], ],
"description": "Lightweight web framework", "description": "Lightweight web framework",
"time": "2023-04-07T17:32:15+00:00" "time": "2023-04-16T14:00:29+00:00"
}, },
{ {
"name": "firebase/php-jwt", "name": "firebase/php-jwt",

View File

@ -80,16 +80,14 @@ class OAuthController
public function getUserInfo() : IContent public function getUserInfo() : IContent
{ {
//TODO: headers should be set by soko-web $authorization = $this->request->header('Authorization');
$headers = getallheaders(); if ($authorization === null) {
if (!isset($headers['Authorization'])) {
return new JsonContent([ return new JsonContent([
'error' => 'No Authorization header was sent.' 'error' => 'No Authorization header was sent.'
]); ]);
} }
$accessToken = substr($headers['Authorization'], strlen('Bearer ')); $accessToken = substr($authorization, strlen('Bearer '));
$token = $this->oAuthTokenRepository->getByAccessToken($accessToken); $token = $this->oAuthTokenRepository->getByAccessToken($accessToken);
if ($token === null || $token->getExpiresDate() < new DateTime()) { if ($token === null || $token->getExpiresDate() < new DateTime()) {

View File

@ -86,6 +86,7 @@ Container::$request = new SokoWeb\Request\Request(
$_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'], $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'],
$_GET, $_GET,
$_POST, $_POST,
getallheaders(),
$_SESSION, $_SESSION,
new RVR\Repository\UserRepository() new RVR\Repository\UserRepository()
); );