aboutsummaryrefslogtreecommitdiffstats
path: root/routes
diff options
context:
space:
mode:
Diffstat (limited to 'routes')
-rw-r--r--routes/users.ts4
1 files 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);