mirror of
https://github.com/MoonTechLab/LunaTV.git
synced 2026-05-18 20:14:41 +08:00
feat: check NEXT_PUBLIC_ENABLE_REGISTER in /api/register
This commit is contained in:
10
README.md
10
README.md
@@ -181,7 +181,10 @@ services:
|
||||
redis:
|
||||
image: redis
|
||||
container_name: moontv-redis
|
||||
estart: unless-stopped
|
||||
restart: unless-stopped
|
||||
# 如需持久化
|
||||
# volumes:
|
||||
# - ./data:/data
|
||||
```
|
||||
|
||||
## 环境变量
|
||||
@@ -228,8 +231,9 @@ MoonTV 支持标准的苹果 CMS V10 API 格式。
|
||||
|
||||
## Roadmap
|
||||
|
||||
- [ ] DB 存储
|
||||
- [ ] 深色模式
|
||||
- [x] 深色模式
|
||||
- [x] 持久化存储
|
||||
- [x] 多账户
|
||||
|
||||
## 安全与隐私提醒
|
||||
|
||||
|
||||
@@ -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