diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-08-01 21:35:25 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-08-01 21:35:25 +0900 |
| commit | f6443042fbec1bd394439904f3c69e23709f7e6a (patch) | |
| tree | 46872e86ed7e42962895e0bfe04064387487523f /frontend/app/.server/auth.ts | |
| parent | 10b9be2c2a46b204f83be7d152ca62bf69e8843e (diff) | |
| parent | 94d5d89aa59b6d1e53dab280c26e3a8fcb22b7e4 (diff) | |
| download | phperkaigi-2025-albatross-f6443042fbec1bd394439904f3c69e23709f7e6a.tar.gz phperkaigi-2025-albatross-f6443042fbec1bd394439904f3c69e23709f7e6a.tar.zst phperkaigi-2025-albatross-f6443042fbec1bd394439904f3c69e23709f7e6a.zip | |
Merge branch 'refactor/api'
Diffstat (limited to 'frontend/app/.server/auth.ts')
| -rw-r--r-- | frontend/app/.server/auth.ts | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/frontend/app/.server/auth.ts b/frontend/app/.server/auth.ts index b80166b..b7e1820 100644 --- a/frontend/app/.server/auth.ts +++ b/frontend/app/.server/auth.ts @@ -3,22 +3,13 @@ import { FormStrategy } from "remix-auth-form"; import { jwtDecode } from "jwt-decode"; import type { Session } from "@remix-run/server-runtime"; import { sessionStorage } from "./session"; -import { apiClient } from "./api/client"; +import { apiPostLogin } from "./api/client"; import { components } from "./api/schema"; export const authenticator = new Authenticator<string>(sessionStorage); async function login(username: string, password: string): Promise<string> { - const { data, error } = await apiClient.POST("/login", { - body: { - username, - password, - }, - }); - if (error) { - throw new Error(error.message); - } - return data.token; + return (await apiPostLogin(username, password)).token; } authenticator.use( |
