update: captcha header

This commit is contained in:
2025-10-09 03:19:49 +07:00
parent 1b384a56b5
commit 7d7891f6ca

View File

@@ -55,6 +55,9 @@ class AuthController {
static async generateCaptcha(req, res) { static async generateCaptcha(req, res) {
try { try {
const { svg, text } = createCaptcha(); const { svg, text } = createCaptcha();
res.setHeader('X-Captcha-Text', text);
return res.status(200).json({ data: { svg, text } }); return res.status(200).json({ data: { svg, text } });
} catch (err) { } catch (err) {
return res.status(500).json(setResponse([], 'Captcha failed', 500)); return res.status(500).json(setResponse([], 'Captcha failed', 500));