feat: Implement password persistence using localStorage, controlled by the new PERSIST_PASSWORD environment variable.

This commit is contained in:
kuekhaoyang
2026-01-25 10:41:24 +08:00
parent 9b3766d1af
commit c492dc310b
5 changed files with 51 additions and 26 deletions
+2
View File
@@ -8,11 +8,13 @@ import { NextRequest, NextResponse } from 'next/server';
export const runtime = 'edge';
const ACCESS_PASSWORD = process.env.ACCESS_PASSWORD || '';
const PERSIST_PASSWORD = process.env.PERSIST_PASSWORD !== 'false';
const SUBSCRIPTION_SOURCES = process.env.SUBSCRIPTION_SOURCES || process.env.NEXT_PUBLIC_SUBSCRIPTION_SOURCES || '';
export async function GET() {
return NextResponse.json({
hasEnvPassword: ACCESS_PASSWORD.length > 0,
persistPassword: PERSIST_PASSWORD,
subscriptionSources: SUBSCRIPTION_SOURCES,
});
}