diff --git a/.docker/development/docker-compose.yml b/.docker/development/docker-compose.yml index e094d89..01f76d6 100644 --- a/.docker/development/docker-compose.yml +++ b/.docker/development/docker-compose.yml @@ -41,7 +41,7 @@ services: links: - postgres:postgres environment: - - DATABASE_URL=postgres://postgres:postgres@postgres:5432/postgres?sslmode=disable + - PGWEB_DATABASE_URL=postgres://postgres:postgres@postgres:5432/postgres?sslmode=disable depends_on: - postgres diff --git a/src/services/captcha.ts b/src/services/captcha.ts index e6cf4ad..68d7c4d 100644 --- a/src/services/captcha.ts +++ b/src/services/captcha.ts @@ -4,16 +4,14 @@ import { StatusError } from '@/services/error'; export async function isValidCaptcha(token: string): Promise { if (!conf.captcha.secret) throw new Error('isValidCaptcha() is called but no secret set'); + const formData = new URLSearchParams(); + formData.append('secret', conf.captcha.secret); + formData.append('response', token); const res = await fetch('https://www.google.com/recaptcha/api/siteverify', { method: 'POST', - body: JSON.stringify({ - secret: conf.captcha.secret, - response: token, - }), - headers: { - 'content-type': 'application/json', - }, + body: formData, }); + const json = await res.json(); return !!json.success; }