feat: login conflict #1127
@ -59,10 +59,19 @@ export const loginController: RequestHandler = async (request, response) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (account.Nonce == 0 || loginRequest.ClientType != "webui") {
|
if (loginRequest.ClientType == "webui") {
|
||||||
|
if (!account.Nonce) {
|
||||||
|
account.ClientType = "webui";
|
||||||
|
account.Nonce = nonce;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (account.Nonce && account.ClientType != "webui" && !loginRequest.kick) {
|
||||||
|
response.status(400).json({ error: "nonce still set" });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
account.ClientType = loginRequest.ClientType;
|
||||||
account.Nonce = nonce;
|
account.Nonce = nonce;
|
||||||
}
|
|
||||||
if (loginRequest.ClientType != "webui") {
|
|
||||||
account.CountryCode = loginRequest.lang.toUpperCase();
|
account.CountryCode = loginRequest.lang.toUpperCase();
|
||||||
}
|
}
|
||||||
await account.save();
|
await account.save();
|
||||||
|
@ -32,6 +32,7 @@ export interface ILoginRequest {
|
|||||||
date: number;
|
date: number;
|
||||||
ClientType: string;
|
ClientType: string;
|
||||||
PS: string;
|
PS: string;
|
||||||
|
kick?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ILoginResponse extends IAccountAndLoginResponseCommons {
|
export interface ILoginResponse extends IAccountAndLoginResponseCommons {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user