Log in as user support

This commit is contained in:
Jamie Curnow
2025-10-29 21:07:00 +10:00
parent 95957a192c
commit 82a1a86c3a
11 changed files with 206 additions and 107 deletions

View File

@@ -37,6 +37,7 @@ export * from "./getToken";
export * from "./getUser";
export * from "./getUsers";
export * from "./helpers";
export * from "./loginAsUser";
export * from "./models";
export * from "./refreshToken";
export * from "./renewCertificate";

View File

@@ -0,0 +1,8 @@
import * as api from "./base";
import type { LoginAsTokenResponse } from "./responseTypes";
export async function loginAsUser(id: number): Promise<LoginAsTokenResponse> {
return await api.post({
url: `/users/${id}/login`,
});
}

View File

@@ -1,4 +1,4 @@
import type { AppVersion } from "./models";
import type { AppVersion, User } from "./models";
export interface HealthResponse {
status: string;
@@ -15,3 +15,7 @@ export interface ValidatedCertificateResponse {
certificate: Record<string, any>;
certificateKey: boolean;
}
export interface LoginAsTokenResponse extends TokenResponse {
user: User;
}