From fc394c6299ff200f4e4f5a95fe34f4e97988632e Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 21 Feb 2025 15:20:53 -0800 Subject: add created to existing apps if missing --- routes/users.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routes/users.ts b/routes/users.ts index 52b9eef7..106cfd4a 100644 --- a/routes/users.ts +++ b/routes/users.ts @@ -863,8 +863,6 @@ export default { if (app && uid !== app.uid) fail("Unauthorized"); if (secret) pubkey = getPublicKey(secret); - if (!app) app = { created: Date.now() }; - app = { ...app, pubkey, @@ -875,6 +873,8 @@ export default { secret, }; + if (!app?.created) app.created = Date.now(); + await s(`app:${pubkey}`, app); await db.sAdd(`${uid}:apps`, pubkey); -- cgit v1.2.3