mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 11:56:01 +01:00
Rate limit the /auth/login route of ETAPI
This commit is contained in:
@@ -3,8 +3,8 @@ const eu = require("./etapi_utils");
|
||||
const passwordEncryptionService = require("../services/password_encryption");
|
||||
const etapiTokenService = require("../services/etapi_tokens");
|
||||
|
||||
function register(router) {
|
||||
eu.NOT_AUTHENTICATED_ROUTE(router, 'post', '/etapi/auth/login', (req, res, next) => {
|
||||
function register(router, loginMiddleware) {
|
||||
eu.NOT_AUTHENTICATED_ROUTE(router, 'post', '/etapi/auth/login', loginMiddleware, (req, res, next) => {
|
||||
const {password, tokenName} = req.body;
|
||||
|
||||
if (!passwordEncryptionService.verifyPassword(password)) {
|
||||
|
||||
Reference in New Issue
Block a user