feat(auth): add session management UI, QR login page, mobile QR support, translations
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
@@ -35,6 +35,14 @@ export interface GenerateTokenResponse {
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
export interface QRClaimResponse {
|
||||
token: string;
|
||||
token_id: number;
|
||||
name: string;
|
||||
owner_id: string;
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
export interface DeviceRegistration {
|
||||
push_token: string;
|
||||
device_name?: string;
|
||||
@@ -157,6 +165,13 @@ class DocuElevateAPI {
|
||||
});
|
||||
}
|
||||
|
||||
/** Claim a QR login challenge and receive an API token. */
|
||||
async claimQRChallenge(challengeToken: string, deviceName: string): Promise<QRClaimResponse> {
|
||||
return this.request<QRClaimResponse>("POST", "/api/qr-auth/claim", {
|
||||
body: { challenge_token: challengeToken, device_name: deviceName },
|
||||
});
|
||||
}
|
||||
|
||||
/** Return profile information for the authenticated user. */
|
||||
async whoAmI(): Promise<WhoAmIResponse> {
|
||||
return this.request<WhoAmIResponse>("GET", "/api/mobile/whoami");
|
||||
|
||||
Reference in New Issue
Block a user