mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Fix non-expiry key actions
This commit is contained in:
@@ -102,7 +102,7 @@ class Create extends Base
|
||||
throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'New API key must have expiry set, because currently authenticated API key has an expiry.');
|
||||
}
|
||||
|
||||
if (!\is_null($expire) && $expire > $apiKey->getExpire()) {
|
||||
if (!\is_null($expire) && !\is_null($apiKey->getExpire()) && $expire > $apiKey->getExpire()) {
|
||||
throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'New API key expiry must be sooner than currently authenticated API key expiry.');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ class Update extends Base
|
||||
throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'Updated API key must have expiry set, because currently authenticated API key has an expiry.');
|
||||
}
|
||||
|
||||
if (!\is_null($expire) && $expire > $apiKey->getExpire()) {
|
||||
if (!\is_null($expire) && !\is_null($apiKey->getExpire()) && $expire > $apiKey->getExpire()) {
|
||||
throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'Updated API key expiry must be sooner than currently authenticated API key expiry.');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user