optional password

This commit is contained in:
Anaïs Saraiva
2026-08-15 10:42:20 +02:00
parent 12d9e99aa2
commit 6e76189e46
7 changed files with 50 additions and 38 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ export async function handleDownload(
}
if (!secretMatches(meta.downloadKeyHash, rawKey)) return notFound();
if (!hasValidAuth(req, secret, rawKey)) {
if (meta.passwordHash && !hasValidAuth(req, secret, rawKey)) {
const url = new URL(req.url);
return renderPasswordForm(rawKey, meta.originalName, url.searchParams.has("e"));
}