Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/openstatusHQ/openstatus. ๐ซ Status page with uptime monitoring & API monitoring as code ๐ซ openstatus.dev
bun drizzle-orm monitoring monitoring-as-code nextjs observability on-call open-source shadcn-ui status-page statuspage synthetic-monitoring tinybird turso uptime uptime-checker uptime-monitor
Something went wrong. Try again.
745 B ยท 24 lines
TSX
12345678910111213141516171819202122232425"use client";
import { useParams } from "next/navigation";import { parseAsString, useQueryState } from "nuqs";import { useEffect } from "react";
import { createProtectedCookieKey } from "../lib/protected";
export function PasswordWrapper({ children }: { children?: React.ReactNode }) { const [password, setPassword] = useQueryState("pw", parseAsString); const { domain } = useParams<{ domain: string }>();
useEffect(() => { if (password) { const key = createProtectedCookieKey(domain); document.cookie = `${key}=${password}; path=/; expires=${new Date( Date.now() + 1000 * 60 * 60 * 24 * 30, ).toUTCString()}`; setPassword(null); } }, [password, domain, setPassword]);
return children;}