Protect Tabularium with persistent authenticator-code login
Verify and deploy Tabularium / verify-and-deploy (push) Successful in 5m28s

This commit is contained in:
2026-10-27 21:48:16 +08:00
parent 0a4057ac2a
commit 9fcfbdb694
31 changed files with 1549 additions and 60 deletions
+17 -1
View File
@@ -52,7 +52,7 @@ export function Navigation({
key={d.slug}
>
{d.title}
{d.slug.includes("draft") && (
{sectionFor(d.slug).label.includes("草案") && (
<span className="tiny-dot" aria-label="草案" />
)}
</Link>
@@ -131,6 +131,22 @@ export function Shell({
<span>搜索文档…</span>
<kbd>⌘ K</kbd>
</button>
<button
className="logout-button"
aria-label="退出登录"
onClick={async () => {
const response = await fetch("/api/auth/logout", {
method: "POST",
});
if (response.ok) {
// Drop cached private document data when ending the session.
// eslint-disable-next-line @next/next/no-location-assign-relative-destination
window.location.assign("/login");
}
}}
>
退出
</button>
</header>
<div className="mobile-bar">
<button