aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-12-02 10:40:45 -0700
committerAdam Soltys <[email protected]>2026-12-02 10:40:45 -0700
commit796999cb8a6fc7abbfb9dc2643e372795fed9882 (patch)
tree0c12b7afe36a7cb1810bb8e3a5b8f129f702b6fc
parentdcda8c643da72ebbecd590ae9e065d1641c96976 (diff)
downloadcoinos-server-796999cb8a6fc7abbfb9dc2643e372795fed9882.tar.gz
coinos-server-796999cb8a6fc7abbfb9dc2643e372795fed9882.zip
users: stamp v3migrated when an account hands its name to v3
`migrated` has been set on every new account since 2023, so it can't tell the names registrar whether an account actually handed its name over. When the account's own session posts the hand-off, also record a server-set `v3migrated` timestamp, and include it in the public user fields so the registrar can require a fresh one before granting the name. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6SSfVopM1ZzXKZmLYU
-rw-r--r--lib/utils.ts2
-rw-r--r--routes/users.ts6
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/utils.ts b/lib/utils.ts
index 539258a4..c52c8a9c 100644
--- a/lib/utils.ts
+++ b/lib/utils.ts
@@ -181,5 +181,7 @@ export const fields = [
"prompt",
"pubkey",
"username",
+ // when this account last handed its name to v3 (see users.update)
+ "v3migrated",
"website",
];
diff --git a/routes/users.ts b/routes/users.ts
index a058e7da..17bf5026 100644
--- a/routes/users.ts
+++ b/routes/users.ts
@@ -497,6 +497,12 @@ export default {
if (typeof body[a] !== "undefined") user[a] = body[a];
}
+ // A v3 hand-off from the /migrate action. Not the same thing as
+ // `migrated`, which every account has carried since 2023. Only the
+ // server sets this, and the names registrar grants the name to a v3
+ // key only while it is fresh.
+ if (body.migrated === true) user.v3migrated = Date.now();
+
user.fresh = false;
user.tip = Math.max(0, Math.min(1000, Number.parseInt(user.tip)));