Skip to content

Commit 90ceb05

Browse files
committed
Apply recaptcha verification for API User#Create
1 parent 5d75bae commit 90ceb05

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/server/routes/api.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import configs from '../../../configs/project/server';
22
import Roles from '../../common/constants/Roles';
33
import bodyParser from '../middlewares/bodyParser';
4+
import verifyRecaptcha from '../middlewares/verifyRecaptcha';
45
import authRequired from '../middlewares/authRequired';
56
import roleRequired from '../middlewares/roleRequired';
67
import fileUpload from '../middlewares/fileUpload';
@@ -16,7 +17,11 @@ export default ({ app }) => {
1617
roleRequired([Roles.ADMIN]),
1718
userController.list
1819
);
19-
app.post('/api/users', bodyParser.json, userController.create);
20+
app.post('/api/users',
21+
bodyParser.json,
22+
verifyRecaptcha,
23+
userController.create
24+
);
2025
app.post('/api/users/login', bodyParser.json, userController.login);
2126
app.get('/api/users/logout', userController.logout);
2227
app.get('/api/users/me', authRequired, userController.show);

0 commit comments

Comments
 (0)