release: v1.2.7 — 登录人机验证(滑块 / Turnstile / Cap)
Publish Docker image / build (linux/amd64, ubuntu-latest, amd64) (push) Canceled after 0s
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm, arm64) (push) Canceled after 0s
Publish Docker image / merge (push) Canceled after 0s
ci / ci (22, ubuntu-latest) (push) Canceled after 0s
GitHub Release / release (push) Canceled after 0s

This commit is contained in:
O96u committed 2026-09-03 13:53:43 +08:00
1 parent 8408d01197
commit 430c4de0f4
42 files changed
+1103 -72

No files matched your search

+9 -2
View File
@@ -5,9 +5,10 @@ import {
isInitialized
} from '../../utils/auth'
import { isAllowRegistration } from '../../utils/db'
import { verifyLoginVerification, type VerificationBody } from '../../utils/login-verification'
import { clientIp, logInfo } from '../../utils/logger'
interface RegisterBody {
interface RegisterBody extends VerificationBody {
username?: string
password?: string
}
@@ -22,6 +23,8 @@ export default defineEventHandler(async (event) => {
}
const body = await readBody<RegisterBody>(event)
await verifyLoginVerification(event, body ?? {})
const username = body?.username?.trim() ?? ''
const password = body?.password ?? ''
@@ -38,7 +41,11 @@ export default defineEventHandler(async (event) => {
return {
success: true,
user: { id: user.id, username: user.username, role: user.role }
user: {
id: user.id,
username: user.username,
role: user.role
}
}
} catch (error: unknown) {
if (error instanceof Error) {