mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-10-27 11:09:04 +01:00
feat: add option to renew API key (#1214)
This commit is contained in:
@@ -13,6 +13,13 @@ export default class ApiKeyService extends APIService {
|
||||
return res.data as ApiKeyResponse;
|
||||
};
|
||||
|
||||
renew = async (id: string, expiresAt: Date): Promise<ApiKeyResponse> => {
|
||||
const res = await this.api.post(`/api-keys/${id}/renew`, {
|
||||
expiresAt
|
||||
});
|
||||
return res.data as ApiKeyResponse;
|
||||
};
|
||||
|
||||
revoke = async (id: string): Promise<void> => {
|
||||
await this.api.delete(`/api-keys/${id}`);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user