Fixing a few bits
This commit is contained in:
@@ -43,8 +43,9 @@ export class NotificationService {
|
|||||||
const payload = JSON.stringify(message);
|
const payload = JSON.stringify(message);
|
||||||
|
|
||||||
const encrypted = this.encrypt(subscription.keys.p256dh, subscription.keys.auth, payload);
|
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 parsedUrl = new URL(subscription.endpoint);
|
||||||
const options: https.RequestOptions = {
|
const options: https.RequestOptions = {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export class VapidService {
|
|||||||
|
|
||||||
async getVapidKeys(): Promise<VapidKeys> {
|
async getVapidKeys(): Promise<VapidKeys> {
|
||||||
return new Promise((resolve, reject) => {
|
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 (err) reject(err);
|
||||||
|
|
||||||
if (row) {
|
if (row) {
|
||||||
|
|||||||
Reference in New Issue
Block a user