1
0
Fork 0
mirror of synced 2024-10-03 02:37:40 +13:00
This commit is contained in:
Matej Bačo 2024-05-14 12:27:35 +00:00
parent 9846b573bd
commit 4d249c5d36

View file

@ -208,7 +208,7 @@ App::init()
[ $keyType, $authKey ] = \explode('_', $apiKey, 2); [ $keyType, $authKey ] = \explode('_', $apiKey, 2);
if($keyType === API_KEY_STANDARD) { if($keyType === API_KEY_DYNAMIC) {
// Dynamic key // Dynamic key
$jwtObj = new JWT(System::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', 900, 10); $jwtObj = new JWT(System::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', 900, 10);
@ -238,11 +238,11 @@ App::init()
Authorization::setRole(Auth::USER_ROLE_APPS); Authorization::setRole(Auth::USER_ROLE_APPS);
Authorization::setDefaultStatus(false); // Cancel security segmentation for API keys. Authorization::setDefaultStatus(false); // Cancel security segmentation for API keys.
} }
} elseif($keyType === API_KEY_DYNAMIC) { } elseif($keyType === API_KEY_STANDARD) {
// Regular key // Regular key
// Check if given key match project API keys // Check if given key match project API keys
$key = $project->find('secret', $authKey, 'keys'); $key = $project->find('secret', $apiKey, 'keys');
if ($key) { if ($key) {
$user = new Document([ $user = new Document([
'$id' => '', '$id' => '',