aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--routes/users.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/routes/users.ts b/routes/users.ts
index 604bdbf5..577d1f5a 100644
--- a/routes/users.ts
+++ b/routes/users.ts
@@ -866,6 +866,8 @@ export default {
if (app && uid !== app.uid) fail("Unauthorized");
if (secret) pubkey = getPublicKey(secret);
+ if (!app) app = { created: Date.now };
+
app = {
...app,
pubkey,
@@ -874,7 +876,6 @@ export default {
name,
uid,
secret,
- created: Date.now(),
};
await s(`app:${pubkey}`, app);