From a9c3373628a37f08fa4ca79acedfd68753cd5906 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Tue, 6 May 2025 03:11:11 +0200 Subject: [PATCH] fix: login failure on U16 --- src/controllers/api/loginController.ts | 4 ++-- src/types/loginTypes.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/controllers/api/loginController.ts b/src/controllers/api/loginController.ts index 4ba97134..01e5af46 100644 --- a/src/controllers/api/loginController.ts +++ b/src/controllers/api/loginController.ts @@ -41,7 +41,7 @@ export const loginController: RequestHandler = async (request, response) => { email: loginRequest.email, password: loginRequest.password, DisplayName: name, - CountryCode: loginRequest.lang.toUpperCase(), + CountryCode: loginRequest.lang?.toUpperCase() ?? "EN", ClientType: loginRequest.ClientType == "webui-register" ? "webui" : loginRequest.ClientType, CrossPlatformAllowed: true, ForceLogoutVersion: 0, @@ -88,7 +88,7 @@ export const loginController: RequestHandler = async (request, response) => { account.ClientType = loginRequest.ClientType; account.Nonce = nonce; - account.CountryCode = loginRequest.lang.toUpperCase(); + account.CountryCode = loginRequest.lang?.toUpperCase() ?? "EN"; account.BuildLabel = buildLabel; } await account.save(); diff --git a/src/types/loginTypes.ts b/src/types/loginTypes.ts index 8bbee787..5fcb0e53 100644 --- a/src/types/loginTypes.ts +++ b/src/types/loginTypes.ts @@ -35,11 +35,11 @@ export interface ILoginRequest { email: string; password: string; time: number; - s: string; - lang: string; + s?: string; + lang?: string; date: number; - ClientType: string; - PS: string; + ClientType?: string; + PS?: string; kick?: boolean; }