diff --git a/server/prisma/dev.db b/server/prisma/dev.db index d456d0f..64afe8b 100644 Binary files a/server/prisma/dev.db and b/server/prisma/dev.db differ diff --git a/webapp/src/lib/model/EncryptedNote.ts b/webapp/src/lib/model/EncryptedNote.ts index e2accf9..d2748db 100644 --- a/webapp/src/lib/model/EncryptedNote.ts +++ b/webapp/src/lib/model/EncryptedNote.ts @@ -1,7 +1,7 @@ export type EncryptedNote = { id: string; insert_time: Date; - expiry_time: Date; + expire_time: Date; ciphertext: string; hmac: string; }; diff --git a/webapp/src/routes/note/[id].svelte b/webapp/src/routes/note/[id].svelte index 146ca15..daf6fc7 100644 --- a/webapp/src/routes/note/[id].svelte +++ b/webapp/src/routes/note/[id].svelte @@ -10,9 +10,14 @@ try { const note: EncryptedNote = await response.json(); note.insert_time = new Date(note.insert_time as unknown as string); - note.expiry_time = new Date(note.expiry_time as unknown as string); + note.expire_time = new Date(note.expire_time as unknown as string); + const maxage = Math.floor((note.expire_time.valueOf() - note.insert_time.valueOf()) / 1000); return { status: response.status, + cache: { + maxage: maxage, + private: false + }, props: { note } }; } catch {