aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/app/.server/api/client.ts
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-08-09 23:30:39 +0900
committernsfisis <nsfisis@gmail.com>2024-08-09 23:30:39 +0900
commit41e98f3b0a936f7982434b74a88b919b99fd94ce (patch)
tree72e1a3cc00044f9c00dc5f22ef9325124f272401 /frontend/app/.server/api/client.ts
parent93f2ffc18d1d86bd2999533e8d904c92cb29bc1a (diff)
parentaf36c59851399194bcbb77a3093d46c2757cb7b4 (diff)
downloadiosdc-japan-2024-albatross-41e98f3b0a936f7982434b74a88b919b99fd94ce.tar.gz
iosdc-japan-2024-albatross-41e98f3b0a936f7982434b74a88b919b99fd94ce.tar.zst
iosdc-japan-2024-albatross-41e98f3b0a936f7982434b74a88b919b99fd94ce.zip
Merge branch 'feat/auth-fortee'
Diffstat (limited to 'frontend/app/.server/api/client.ts')
-rw-r--r--frontend/app/.server/api/client.ts14
1 files changed, 12 insertions, 2 deletions
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<paths>({
: "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;