aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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
}