feat: login conflict
This commit is contained in:
parent
92d53e1c00
commit
eedb9e3137
@ -59,10 +59,19 @@ export const loginController: RequestHandler = async (request, response) => {
|
||||
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;
|
||||
}
|
||||
if (loginRequest.ClientType != "webui") {
|
||||
account.CountryCode = loginRequest.lang.toUpperCase();
|
||||
}
|
||||
await account.save();
|
||||
|
@ -32,6 +32,7 @@ export interface ILoginRequest {
|
||||
date: number;
|
||||
ClientType: string;
|
||||
PS: string;
|
||||
kick?: boolean;
|
||||
}
|
||||
|
||||
export interface ILoginResponse extends IAccountAndLoginResponseCommons {
|
||||
|
Loading…
x
Reference in New Issue
Block a user