返回提交历史
Modified
src/controllers/api/loginController.ts
+6
-2
XFEstudio/XFESpaceNinjaServer
fix: login failure on U32 veilbreaker (#1932)
Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1932 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
2c3043f4
代码差异
1 个文件
+6
-2
@@ -7,6 +7,7 @@ import { Account } from "@/src/models/loginModel";
7
7
import { createAccount, isCorrectPassword, isNameTaken } from "@/src/services/loginService";
8
8
import { IDatabaseAccountJson, ILoginRequest, ILoginResponse } from "@/src/types/loginTypes";
9
9
import { logger } from "@/src/utils/logger";
10
import { version_compare } from "@/src/services/worldStateService";
10
11
11
12
export const loginController: RequestHandler = async (request, response) => {
12
13
const loginRequest = JSON.parse(String(request.body)) as ILoginRequest; // parse octet stream of json data to json object
@@ -94,7 +95,7 @@ export const loginController: RequestHandler = async (request, response) => {
94
95
};
95
96
96
97
const createLoginResponse = (myAddress: string, account: IDatabaseAccountJson, buildLabel: string): ILoginResponse => {
97
return {
98
const resp: ILoginResponse = {
98
99
id: account.id,
99
100
DisplayName: account.DisplayName,
100
101
CountryCode: account.CountryCode,
@@ -108,11 +109,14 @@ const createLoginResponse = (myAddress: string, account: IDatabaseAccountJson, b
108
109
Nonce: account.Nonce,
109
110
Groups: [],
110
111
IRC: config.myIrcAddresses ?? [myAddress],
111
platformCDNs: [`https://${myAddress}/`],
112
112
HUB: `https://${myAddress}/api/`,
113
113
NRS: config.NRS,
114
114
DTLS: 99,
115
115
BuildLabel: buildLabel,
116
116
MatchmakingBuildId: buildConfig.matchmakingBuildId
117
117
};
118
if (version_compare(buildLabel, "2023.04.25.23.40") >= 0) {
119
resp.platformCDNs = [`https://${myAddress}/`];
120
}
121
return resp;
118
122
};