api v6 fixes
This commit is contained in:
parent
e41715297f
commit
93a316cb6e
@ -47,7 +47,18 @@ router.post(
|
|||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
async (req: Request, res: Response) => {
|
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();
|
const config = Config.get();
|
||||||
|
|
||||||
|
|||||||
@ -87,7 +87,7 @@ export interface IdentifySchema {
|
|||||||
properties: {
|
properties: {
|
||||||
// bruh discord really uses $ in the property key, so we need to double prefix it, because instanceOf treats $ (prefix) as a optional key
|
// 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?: string;
|
||||||
os_atch?: string;
|
os_arch?: string;
|
||||||
browser?: string;
|
browser?: string;
|
||||||
device?: string;
|
device?: string;
|
||||||
$os?: string;
|
$os?: string;
|
||||||
@ -118,6 +118,7 @@ export interface IdentifySchema {
|
|||||||
shard?: bigint[]; // puyo: changed from [bigint, bigint] because it breaks openapi
|
shard?: bigint[]; // puyo: changed from [bigint, bigint] because it breaks openapi
|
||||||
guild_subscriptions?: boolean;
|
guild_subscriptions?: boolean;
|
||||||
capabilities?: number;
|
capabilities?: number;
|
||||||
|
synced_guilds?: unknown[]; // ok
|
||||||
client_state?: {
|
client_state?: {
|
||||||
guild_hashes?: unknown;
|
guild_hashes?: unknown;
|
||||||
highest_last_message_id?: number;
|
highest_last_message_id?: number;
|
||||||
|
|||||||
@ -17,7 +17,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export interface LoginSchema {
|
export interface LoginSchema {
|
||||||
login: string;
|
login?: string;
|
||||||
|
email?: string;
|
||||||
/**
|
/**
|
||||||
* @minLength 1
|
* @minLength 1
|
||||||
* @maxLength 72
|
* @maxLength 72
|
||||||
|
|||||||
Reference in New Issue
Block a user