mirror of
https://github.com/MoonTechLab/LunaTV.git
synced 2026-05-14 00:39:37 +08:00
feat: check NEXT_PUBLIC_ENABLE_REGISTER in /api/register
This commit is contained in:
@@ -20,6 +20,11 @@ export async function POST(req: NextRequest) {
|
||||
);
|
||||
}
|
||||
|
||||
// 校验是否开放注册
|
||||
if (process.env.NEXT_PUBLIC_ENABLE_REGISTER !== 'true') {
|
||||
return NextResponse.json({ error: '当前未开放注册' }, { status: 400 });
|
||||
}
|
||||
|
||||
const { username, password } = await req.json();
|
||||
|
||||
if (!username || typeof username !== 'string') {
|
||||
|
||||
Reference in New Issue
Block a user