From af36c59851399194bcbb77a3093d46c2757cb7b4 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 9 Aug 2024 23:30:10 +0900 Subject: feat: support authentication via fortee --- frontend/app/.server/api/client.ts | 14 ++++++++++++-- frontend/app/.server/api/schema.d.ts | 2 ++ 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'frontend/app/.server/api') diff --git a/frontend/app/.server/api/client.ts b/frontend/app/.server/api/client.ts index 0db4c14..aae1723 100644 --- a/frontend/app/.server/api/client.ts +++ b/frontend/app/.server/api/client.ts @@ -8,9 +8,19 @@ const apiClient = createClient({ : "http://api-server/api/", }); -export async function apiPostLogin(username: string, password: string) { +export async function apiPostLogin( + username: string, + password: string, + registrationToken: string | null, +) { const { data, error } = await apiClient.POST("/login", { - body: { username, password }, + body: { + username, + password, + ...(registrationToken !== null + ? { registration_token: registrationToken } + : {}), + }, }); if (error) throw new Error(error.message); return data; diff --git a/frontend/app/.server/api/schema.d.ts b/frontend/app/.server/api/schema.d.ts index 6981dea..9a96f19 100644 --- a/frontend/app/.server/api/schema.d.ts +++ b/frontend/app/.server/api/schema.d.ts @@ -286,6 +286,8 @@ export interface operations { username: string; /** @example password123 */ password: string; + /** @example xxxxxxxxxxxxxxxx */ + registration_token?: string; }; }; }; -- cgit v1.2.3-70-g09d2