aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-03 13:04:46 -0700
committerAdam Soltys <[email protected]>2026-08-03 13:04:46 -0700
commitae1f4cab867e3ff5e2f8631ee18b1031cb8b0e52 (patch)
treef5341c0565de1a74983632f9f0dcf11e9c47c9cf
parentcf6121216a9f21b75e983d9105e8702e54b907c9 (diff)
downloadcoinosv3-server-ae1f4cab867e3ff5e2f8631ee18b1031cb8b0e52.tar.gz
coinosv3-server-ae1f4cab867e3ff5e2f8631ee18b1031cb8b0e52.zip
Registrar: a migrated legacy name is claimable
takenByCoinosUser now reads the account it finds: a live one still blocks the name, but one flagged migrated has handed receiving over, so v3 may claim it. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Wvj4aoeMZwA7VUGdJP9Swi
-rw-r--r--names/server.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/names/server.js b/names/server.js
index 74bcb9b..3ebfa48 100644
--- a/names/server.js
+++ b/names/server.js
@@ -376,7 +376,11 @@ async function takenByCoinosUser(domain, name) {
if (domain !== 'coinos.io') return false;
try {
const r = await fetch(`https://coinos.io/api/users/${encodeURIComponent(name)}`);
- return r.status === 200;
+ if (r.status !== 200) return false;
+ // A migrated account has handed its name over: the old site keeps the
+ // account and its history, but receiving belongs to us now.
+ const u = await r.json().catch(() => null);
+ return !(u && u.migrated);
} catch { return true; } // can't verify → refuse rather than squat
}