Compare commits

..

No commits in common. "45a22c2dd44532c42d99ad08926987aca78c3606" and "b5cb59d3ee4f41646ae3df08b4fe3b3e7468310d" have entirely different histories.

4 changed files with 10 additions and 9 deletions

View File

@ -10,7 +10,7 @@
}
],
"require": {
"esoko/soko-web": "0.2.1",
"esoko/soko-web": "0.1",
"firebase/php-jwt": "^6.4"
},
"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",
"This file is @generated automatically"
],
"content-hash": "695034ad53031c4fdacbc6f551d610e3",
"content-hash": "f2dcf297a4a619bc5edfe7b4fac0836e",
"packages": [
{
"name": "esoko/soko-web",
"version": "v0.2.1",
"version": "v0.1",
"source": {
"type": "git",
"url": "https://git.esoko.eu/esoko/soko-web.git",
"reference": "4af7ae352108e7ba151fca2633ff4b40b3194b32"
"reference": "a17a88e9d44e42cef3d996fc66b4dd1134b85def"
},
"require": {
"phpmailer/phpmailer": "^6.8",
@ -33,7 +33,7 @@
"GNU GPL 3.0"
],
"description": "Lightweight web framework",
"time": "2023-04-16T14:00:29+00:00"
"time": "2023-04-07T17:32:15+00:00"
},
{
"name": "firebase/php-jwt",

View File

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

View File

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