add diaposine

This commit is contained in:
Kirill
2026-06-03 18:52:44 +05:00
parent 01f5b90c99
commit 11c1e012d5
+1
View File
@@ -22,6 +22,7 @@ export function registerAuth(fastify) {
if (allowedList.length > 0) { if (allowedList.length > 0) {
const reqIp = normalizeIp(request.ip) const reqIp = normalizeIp(request.ip)
request.log.info({ reqIp, rawIp: request.ip }, '[auth] admin IP check')
const isAllowed = allowedList.includes(reqIp) || allowedList.some((entry) => cidrMatch(reqIp, entry)) const isAllowed = allowedList.includes(reqIp) || allowedList.some((entry) => cidrMatch(reqIp, entry))
if (!isAllowed) { if (!isAllowed) {
return reply.code(403).send({ error: 'Доступ с данного IP запрещён' }) return reply.code(403).send({ error: 'Доступ с данного IP запрещён' })