Initial commit: Cat Sitting Planner with PWA, SQLite, and Webhook Notifications

This commit is contained in:
2026-01-12 20:48:23 +01:00
commit 3121ef223d
52 changed files with 13722 additions and 0 deletions

25
app/actions/auth.ts Normal file
View File

@@ -0,0 +1,25 @@
"use server"
import { cookies } from "next/headers"
import prisma from "@/lib/prisma"
export async function verifyPlanPassword(planId: string, password: string) {
const plan = await prisma.plan.findUnique({
where: { id: planId },
})
if (!plan) return false
if (plan.password === password) {
// Set a simple cookie to authorize this plan
(await cookies()).set(`plan_auth_${planId}`, "true", {
httpOnly: true,
secure: process.env.NODE_ENV === "production",
maxAge: 60 * 60 * 24 * 30, // 30 days
path: "/",
})
return true
}
return false
}