支持速率限制
然后把oauth单独放一个页面 一些UI调整
This commit is contained in:
@ -6,11 +6,12 @@ const {
|
||||
loginValidation,
|
||||
handleValidationErrors
|
||||
} = require('../middleware/validation');
|
||||
const { authLimiter } = require('../middleware/rateLimit');
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
// 注册路由
|
||||
router.post('/register', registerValidation, handleValidationErrors, async (req, res) => {
|
||||
router.post('/register', authLimiter, registerValidation, handleValidationErrors, async (req, res) => {
|
||||
try {
|
||||
const { username, email, password } = req.body;
|
||||
|
||||
@ -62,7 +63,7 @@ router.post('/register', registerValidation, handleValidationErrors, async (req,
|
||||
});
|
||||
|
||||
// 登录路由
|
||||
router.post('/login', loginValidation, handleValidationErrors, async (req, res) => {
|
||||
router.post('/login', authLimiter, loginValidation, handleValidationErrors, async (req, res) => {
|
||||
try {
|
||||
const { username, password } = req.body;
|
||||
|
||||
|
Reference in New Issue
Block a user