mirror of
https://github.com/xiaoxinpro/nginx-proxy-manager-zh.git
synced 2025-01-22 12:58:13 -05:00
Return generic auth error to prevent user enumeration attacks
On invalid user/password error the error message "Invalid email or password" is returned. Thereby, no information about the existence of the user is given.
This commit is contained in:
parent
25a26d6175
commit
640a1eeb68
@ -5,6 +5,8 @@ const authModel = require('../models/auth');
|
|||||||
const helpers = require('../lib/helpers');
|
const helpers = require('../lib/helpers');
|
||||||
const TokenModel = require('../models/token');
|
const TokenModel = require('../models/token');
|
||||||
|
|
||||||
|
const ERROR_MESSAGE_INVALID_AUTH = 'Invalid email or password';
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -69,15 +71,15 @@ module.exports = {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
throw new error.AuthError('Invalid password');
|
throw new error.AuthError(ERROR_MESSAGE_INVALID_AUTH);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
throw new error.AuthError('No password auth for user');
|
throw new error.AuthError(ERROR_MESSAGE_INVALID_AUTH);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
throw new error.AuthError('No relevant user found');
|
throw new error.AuthError(ERROR_MESSAGE_INVALID_AUTH);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user