Add JRPC API, reworked Login and User pages
This commit is contained in:
38
InternalAPI/twofactor.jrpc
Normal file
38
InternalAPI/twofactor.jrpc
Normal file
@ -0,0 +1,38 @@
|
||||
enum TFAType {
|
||||
TOTP = 0,
|
||||
BACKUP_CODE = 1,
|
||||
WEBAUTHN = 2,
|
||||
APP_ALLOW = 3
|
||||
}
|
||||
|
||||
type TFAOption {
|
||||
id: string;
|
||||
name?: string;
|
||||
expires?: int;
|
||||
tfatype: TFAType;
|
||||
}
|
||||
|
||||
type TFANewTOTP {
|
||||
id: string;
|
||||
secret: string;
|
||||
qr: string;
|
||||
}
|
||||
|
||||
type TFAWebAuthRegister {
|
||||
id: string;
|
||||
challenge: string;
|
||||
}
|
||||
|
||||
service TFAService {
|
||||
GetOptions(): TFAOption[];
|
||||
Delete(id: string): void;
|
||||
|
||||
AddTOTP(name: string): TFANewTOTP;
|
||||
VerifyTOTP(id: string, code: string): void;
|
||||
|
||||
AddWebauthn(name: string): TFAWebAuthRegister;
|
||||
VerifyWebAuthn(id: string, registration_response: string): void;
|
||||
|
||||
AddBackupCodes(name:string): string[];
|
||||
RemoveBackupCodes(id: string): void;
|
||||
}
|
Reference in New Issue
Block a user