diff options
Diffstat (limited to 'frontend/app/.server')
| -rw-r--r-- | frontend/app/.server/api/client.ts | 9 | ||||
| -rw-r--r-- | frontend/app/.server/api/schema.d.ts | 2 | ||||
| -rw-r--r-- | frontend/app/.server/auth.ts | 9 |
3 files changed, 2 insertions, 18 deletions
diff --git a/frontend/app/.server/api/client.ts b/frontend/app/.server/api/client.ts index edcffc1..fef1508 100644 --- a/frontend/app/.server/api/client.ts +++ b/frontend/app/.server/api/client.ts @@ -8,18 +8,11 @@ const apiClient = createClient<paths>({ : "http://api-server/phperkaigi/2025/code-battle/api/", }); -export async function apiPostLogin( - username: string, - password: string, - registrationToken: string | null, -) { +export async function apiPostLogin(username: string, password: string) { const { data, error } = await apiClient.POST("/login", { body: { username, password, - ...(registrationToken !== null - ? { registration_token: registrationToken } - : {}), }, }); if (error) throw new Error(error.message); diff --git a/frontend/app/.server/api/schema.d.ts b/frontend/app/.server/api/schema.d.ts index 7fd612e..1afed69 100644 --- a/frontend/app/.server/api/schema.d.ts +++ b/frontend/app/.server/api/schema.d.ts @@ -321,8 +321,6 @@ export interface operations { username: string; /** @example password123 */ password: string; - /** @example xxxxxxxxxxxxxxxx */ - registration_token?: string; }; }; }; diff --git a/frontend/app/.server/auth.ts b/frontend/app/.server/auth.ts index 4df0924..ac8afe8 100644 --- a/frontend/app/.server/auth.ts +++ b/frontend/app/.server/auth.ts @@ -14,14 +14,7 @@ authenticator.use( new FormStrategy(async ({ form }) => { const username = String(form.get("username")); const password = String(form.get("password")); - const registrationToken = String(form.get("registration_token")); - return ( - await apiPostLogin( - username, - password, - registrationToken === "" ? null : registrationToken, - ) - ).token; + return (await apiPostLogin(username, password)).token; }), "default", ); |
