diff options
| author | Adam Soltys <[email protected]> | 2025-02-19 13:53:35 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-02-19 13:53:48 -0800 |
| commit | 3a4cc3a7b3eede4c5ee08f90243ffc3ca915e050 (patch) | |
| tree | 3b00dfe4bb1f8a8d0fd261e4c07878c886c7eae0 /routes/users.ts | |
| parent | 42cba316079603cc916096b30a3a0d9176a61b98 (diff) | |
| download | coinos-server-3a4cc3a7b3eede4c5ee08f90243ffc3ca915e050.tar.gz coinos-server-3a4cc3a7b3eede4c5ee08f90243ffc3ca915e050.zip | |
set app created time
Diffstat (limited to 'routes/users.ts')
| -rw-r--r-- | routes/users.ts | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/routes/users.ts b/routes/users.ts index 9d133ff3..604bdbf5 100644 --- a/routes/users.ts +++ b/routes/users.ts @@ -862,11 +862,24 @@ export default { const { user } = req; const uid = user.id; let app = await g(pubkey); + if (app && uid !== app.uid) fail("Unauthorized"); if (secret) pubkey = getPublicKey(secret); - app = { ...app, pubkey, max_amount, budget_renewal, name, uid, secret }; + + app = { + ...app, + pubkey, + max_amount, + budget_renewal, + name, + uid, + secret, + created: Date.now(), + }; + await s(`app:${pubkey}`, app); await db.sAdd(`${uid}:apps`, pubkey); + res.send({}); } catch (e) { console.log(e); |
