server: set vapid keys on initial setup
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/lint-foundkey-js Pipeline was successful
ci/woodpecker/pr/lint-backend Pipeline failed
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/test Pipeline failed

This commit is contained in:
Johann150 2022-11-21 22:30:34 +01:00
parent 563f3672a9
commit 01fa4332c2
Signed by: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -35,8 +35,11 @@ async function getMeta(): Promise<void> {
},
});
if (metas.length === 0) {
const { publicKey, privateKey } = push.generateVAPIDKeys();
await db.manager.insert(Meta, {
id: 'x',
swPublicKey: publicKey,
swPrivateKey: privateKey,
});
metas = await db.manager.find(Meta, {
order: {