first commit

This commit is contained in:
Beyhan Oğur
2026-04-26 22:07:47 +03:00
commit 5285a0dd86
522 changed files with 41738 additions and 0 deletions

23
server/api/verify.post.ts Normal file
View File

@@ -0,0 +1,23 @@
export default defineEventHandler(async (event) => {
const body = await readBody(event)
const token = body.token
if (!token) {
throw createError({
statusCode: 422,
statusMessage: 'Token not provided.',
})
}
// NuxtTurnstile modülünün sağladığı sunucu fonksiyonu
const validation = await verifyTurnstileToken(token)
if (!validation.success) {
throw createError({
statusCode: 400,
statusMessage: 'Captcha validation failed.',
})
}
return { success: true }
})