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
commit436af47e7219126f4c9b4e8d25c99a98bf6c37cb (patch)
tree42ace05b0ed98dc3313053167a15421e88155dcf
parent444d01d69e0a30659fc769a57fe5e070ef025b2e (diff)
downloadcoinosv3-436af47e7219126f4c9b4e8d25c99a98bf6c37cb.tar.gz
coinosv3-436af47e7219126f4c9b4e8d25c99a98bf6c37cb.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
}