Can generate reset access token for an account

This commit is contained in:
2021-05-14 15:33:04 +02:00
parent 585a66ef0a
commit 9b0f3c1fec
3 changed files with 66 additions and 1 deletions

View File

@ -39,6 +39,11 @@ export interface AdminAccountKey {
time_add: number;
}
export interface AdminResetToken {
token: string;
expire: number;
}
const SESSION_STORAGE_TOKEN = "auth_token";
let currentAccount: AdminAccount | null = null;
@ -150,6 +155,17 @@ export class AccountHelper {
});
}
/**
* Generate a access reset token for an admin
*
* @param adminID The id of the target administrator
*/
static async GenerateResetToken(adminID: number): Promise<AdminResetToken> {
return await serverRequest("accounts/generate_reset_token", {
id: adminID,
});
}
/**
* First step of access key enrollment
*/