diff --git a/src/api/routes/auth/login.ts b/src/api/routes/auth/login.ts index 91590544..75c3a26e 100644 --- a/src/api/routes/auth/login.ts +++ b/src/api/routes/auth/login.ts @@ -47,7 +47,18 @@ router.post( }, }), async (req: Request, res: Response) => { - const { login, password, captcha_key, undelete } = req.body as LoginSchema; + const body = req.body as LoginSchema; + const login = body.login ?? body.email + const { password, captcha_key, undelete } = body; + + if (!login) { + throw FieldErrors({ + login: { + code: "required", + message: "Missing email", + }, + }); + } const config = Config.get(); diff --git a/src/schemas/gateway/IdentifySchema.ts b/src/schemas/gateway/IdentifySchema.ts index f14f43d0..83844da1 100644 --- a/src/schemas/gateway/IdentifySchema.ts +++ b/src/schemas/gateway/IdentifySchema.ts @@ -87,7 +87,7 @@ export interface IdentifySchema { properties: { // bruh discord really uses $ in the property key, so we need to double prefix it, because instanceOf treats $ (prefix) as a optional key os?: string; - os_atch?: string; + os_arch?: string; browser?: string; device?: string; $os?: string; @@ -118,6 +118,7 @@ export interface IdentifySchema { shard?: bigint[]; // puyo: changed from [bigint, bigint] because it breaks openapi guild_subscriptions?: boolean; capabilities?: number; + synced_guilds?: unknown[]; // ok client_state?: { guild_hashes?: unknown; highest_last_message_id?: number; diff --git a/src/schemas/uncategorised/LoginSchema.ts b/src/schemas/uncategorised/LoginSchema.ts index 55b6a020..9009e891 100644 --- a/src/schemas/uncategorised/LoginSchema.ts +++ b/src/schemas/uncategorised/LoginSchema.ts @@ -17,7 +17,8 @@ */ export interface LoginSchema { - login: string; + login?: string; + email?: string; /** * @minLength 1 * @maxLength 72