Fixing a few bits

This commit is contained in:
Matthew Raymer
2023-08-13 20:34:50 +08:00
parent 38097e5ba4
commit b37acb4736
2 changed files with 3 additions and 2 deletions

View File

@@ -43,8 +43,9 @@ export class NotificationService {
const payload = JSON.stringify(message);
const encrypted = this.encrypt(subscription.keys.p256dh, subscription.keys.auth, payload);
const endpoint = subscription.endpoint;
const vapidHeaders = await this.vapidService.createVapidAuthHeader();
const vapidHeaders = await this.vapidService.createVapidAuthHeader(endpoint, 12 * 60 * 60, 'mailto:example@example.com');
const parsedUrl = new URL(subscription.endpoint);
const options: https.RequestOptions = {

View File

@@ -31,7 +31,7 @@ export class VapidService {
async getVapidKeys(): Promise<VapidKeys> {
return new Promise((resolve, reject) => {
this.db.get('SELECT publicKey, privateKey FROM vapid WHERE id = ?', [1], (err, row) => {
this.db.get('SELECT publicKey, privateKey FROM vapid WHERE id = ?', [1], (err, row: VapidKeys) => {
if (err) reject(err);
if (row) {