From 355a70d366e2ad161ddf17b12fcb73368202e7d0 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Sat, 3 May 2025 17:48:01 -0700 Subject: [PATCH] fix: login failure on u23 and below (#1972) Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1972 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com> --- src/controllers/api/loginController.ts | 7 +++++-- src/types/loginTypes.ts | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/controllers/api/loginController.ts b/src/controllers/api/loginController.ts index 013e9067..4ba97134 100644 --- a/src/controllers/api/loginController.ts +++ b/src/controllers/api/loginController.ts @@ -103,13 +103,16 @@ const createLoginResponse = (myAddress: string, account: IDatabaseAccountJson, b CountryCode: account.CountryCode, AmazonAuthToken: account.AmazonAuthToken, AmazonRefreshToken: account.AmazonRefreshToken, - ConsentNeeded: account.ConsentNeeded, - TrackedSettings: account.TrackedSettings, Nonce: account.Nonce, IRC: config.myIrcAddresses ?? [myAddress], NRS: config.NRS, BuildLabel: buildLabel }; + if (version_compare(buildLabel, "2018.11.08.14.45") >= 0) { + // U24 and up + resp.ConsentNeeded = account.ConsentNeeded; + resp.TrackedSettings = account.TrackedSettings; + } if (version_compare(buildLabel, "2019.08.29.20.01") >= 0) { // U25.7 and up resp.ForceLogoutVersion = account.ForceLogoutVersion; diff --git a/src/types/loginTypes.ts b/src/types/loginTypes.ts index fc4bef6a..8bbee787 100644 --- a/src/types/loginTypes.ts +++ b/src/types/loginTypes.ts @@ -8,8 +8,8 @@ export interface IAccountAndLoginResponseCommons { ForceLogoutVersion?: number; AmazonAuthToken?: string; AmazonRefreshToken?: string; - ConsentNeeded: boolean; - TrackedSettings: string[]; + ConsentNeeded?: boolean; + TrackedSettings?: string[]; Nonce: number; }