From 849b257db7d43c2f1d13d9620ce7f6ba9dfd3e50 Mon Sep 17 00:00:00 2001 From: Madeline <46743919+MaddyUnderStars@users.noreply.github.com> Date: Mon, 26 Sep 2022 22:08:14 +1000 Subject: Move schemas to /src/util/schemas --- src/api/routes/auth/login.ts | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src/api/routes/auth/login.ts') diff --git a/src/api/routes/auth/login.ts b/src/api/routes/auth/login.ts index bcaccb30..9bed5aab 100644 --- a/src/api/routes/auth/login.ts +++ b/src/api/routes/auth/login.ts @@ -1,21 +1,12 @@ import { Request, Response, Router } from "express"; import { route, getIpAdress, verifyCaptcha } from "@fosscord/api"; import bcrypt from "bcrypt"; -import { Config, User, generateToken, adjustEmail, FieldErrors } from "@fosscord/util"; +import { Config, User, generateToken, adjustEmail, FieldErrors, LoginSchema } from "@fosscord/util"; import crypto from "crypto"; const router: Router = Router(); export default router; -export interface LoginSchema { - login: string; - password: string; - undelete?: boolean; - captcha_key?: string; - login_source?: string; - gift_code_sku_id?: string; -} - router.post("/", route({ body: "LoginSchema" }), async (req: Request, res: Response) => { const { login, password, captcha_key, undelete } = req.body as LoginSchema; const email = adjustEmail(login); -- cgit 1.5.1