123456789101112131415161718192021222324252627 |
- const router = require('express').Router();
- const svgCaptcha = require('svg-captcha');
- const progress = require("../maps/progress");
- router.get('/', async(req, res) => {
- let captcha = svgCaptcha.create({
- noise: 7,
- size: 4,
- ignoreChars: '0oi',
- color: true,
-
- });
- req.session[progress.captchaSessionField] = captcha.text.toLowerCase();
- console.log(req.session[progress.captchaSessionField]);
- res.type('svg');
- res.status(200).send(captcha.data);
- });
- module.exports = router;
|