feat: add dev startup script, fix push notifications, and scope test sends to device
- pnpm dev:local/dev:reset: orchestrate DB container, migrations, seed, and Next.js dev server in one command; Caddy snippet + docs for HTTPS via dev.ginnoir.com - Fix dev login on HTTPS: set both authjs.session-token and __Secure-authjs.session-token so Auth.js finds the session regardless of cookie name resolution - Suppress hydration mismatch on <html> caused by pre-paint script changing data-nav before React hydrates - VAPID startup warning if keys not configured; remove dead NEXT_PUBLIC_VAPID_PUBLIC_KEY var - PushOptIn: hydrate subscription state on mount; reuse existing subscription on iOS to avoid redundant prompts - sendPushToEndpoint: new function to send to a single device endpoint - sendTestNotification: scoped to the calling device's endpoint (ownership-verified) instead of all user subscriptions
This commit is contained in:
@@ -2,5 +2,15 @@ export async function register() {
|
||||
if (process.env.NEXT_RUNTIME === "nodejs") {
|
||||
const { startReminderWorker } = await import("@/modules/_core/reminders");
|
||||
startReminderWorker();
|
||||
|
||||
const vapidSubject = process.env["VAPID_SUBJECT"];
|
||||
const vapidPublic = process.env["VAPID_PUBLIC_KEY"];
|
||||
const vapidPrivate = process.env["VAPID_PRIVATE_KEY"];
|
||||
if (!vapidSubject || !vapidPublic || !vapidPrivate) {
|
||||
console.warn(
|
||||
"[famapp] VAPID keys not configured — web push notifications are disabled. " +
|
||||
"Run `pnpm vapid:generate` and add VAPID_SUBJECT, VAPID_PUBLIC_KEY, VAPID_PRIVATE_KEY to .env",
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user