mirror of
https://gitlab.com/comunic/comunicconsole
synced 2025-06-20 16:45:17 +00:00
Can generate reset access token for an account
This commit is contained in:
@ -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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user