small fix
This commit is contained in:
parent
0c435b9c3b
commit
2d7bc4fb16
|
@ -779,7 +779,7 @@ App::post('/v1/projects/:projectId/keys')
|
|||
->param('expire', null, new Integer() , 'Key expiration timestamp', true)
|
||||
->inject('response')
|
||||
->inject('dbForConsole')
|
||||
->action(function (string $projectId, string $name, array $scopes, int $expire, Response $response, Database $dbForConsole) {
|
||||
->action(function (string $projectId, string $name, array $scopes, int|null $expire, Response $response, Database $dbForConsole) {
|
||||
|
||||
$project = $dbForConsole->getDocument('projects', $projectId);
|
||||
|
||||
|
@ -888,7 +888,7 @@ App::put('/v1/projects/:projectId/keys/:keyId')
|
|||
->param('expire', null, new Integer() , 'Key expiration timestamp', true)
|
||||
->inject('response')
|
||||
->inject('dbForConsole')
|
||||
->action(function (string $projectId, string $keyId, string $name, array $scopes, int $expire, Response $response, Database $dbForConsole) {
|
||||
->action(function (string $projectId, string $keyId, string $name, array $scopes, int|null $expire, Response $response, Database $dbForConsole) {
|
||||
|
||||
$project = $dbForConsole->getDocument('projects', $projectId);
|
||||
|
||||
|
|
|
@ -281,7 +281,7 @@ App::init(function (App $utopia, Request $request, Response $response, Document
|
|||
|
||||
$expire = $key->getAttribute('expire', 0);
|
||||
|
||||
if($expire !== 0 && $expire < \time()){
|
||||
if(!empty($expire) && $expire < \time()){
|
||||
throw new AppwriteException('Project key expired', 401, AppwriteException:: PROJECT_KEY_EXPIRED);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue