fix: device ids optional until players update to client 1.3.0

A sign-in without device ids is let in unless AJ_REQUIRE_DEVICE=1. An
account seen on banned hardware is still refused, with the ban's reason,
when its client sends no ids. The privacy policy no longer says the
client cannot sign in without them.
This commit is contained in:
Burrowdev committed 2026-10-17 23:54:46 +03:00
1 parent 31cbd87ff8
commit 13c2f04d52
3 files changed
+11 -7

No files matched your search

+4 -2
View File
@@ -439,8 +439,10 @@ const authenticate = async (req, res, from) => {
send(res, 401, {error_code: 101, error: "address_banned", banned_seconds: world.moderation.PERMANENT, ban_reason: addressBan.reason});
return;
}
// A banned computer (lib/devices.js): for good, whichever account.
const deviceBan = device && devices.banOf(device);
// A banned computer (lib/devices.js): for good, whichever account. a
// client that sent no ids (before 1.3.0) is judged by the hardware the
// account was seen on.
const deviceBan = device ? devices.banOf(device) : devices.banOfAccount(account);
if (deviceBan) {
console.log(`[devices] "${account.username}" refused: hardware banned (ban ${deviceBan.id})`);
send(res, 401, {error_code: 101, error: "device_banned", banned_seconds: world.moderation.PERMANENT, ban_reason: deviceBan.reason});