fix: naming convention
This commit is contained in:
parent
c080a7e7bc
commit
1a95a8b689
@ -82,7 +82,7 @@ const config = {
|
||||
},
|
||||
analytics: {
|
||||
enabled: JSON.parse(SECRET_ANALYTICS_ENABLED),
|
||||
ipSalt: SECRET_ANALYTICS_HMAC_SECRET,
|
||||
hmacSecret: SECRET_ANALYTICS_HMAC_SECRET,
|
||||
},
|
||||
logger: true,
|
||||
cors: '*',
|
||||
|
@ -5,12 +5,12 @@ import { getCacheKey, getFromCache, setCache } from '../helpers/cache.js';
|
||||
import getClientIp from '../helpers/client-ip.js';
|
||||
import prisma from '../services/prisma.js';
|
||||
|
||||
const { enabled, ipSalt } = config.get('analytics');
|
||||
const { enabled, hmacSecret } = config.get('analytics');
|
||||
|
||||
function createUniqueId(ip, userAgent) {
|
||||
// Use HMAC for secure hashing
|
||||
return crypto
|
||||
.createHmac('sha256', ipSalt)
|
||||
.createHmac('sha256', hmacSecret)
|
||||
.update(ip + userAgent)
|
||||
.digest('hex');
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user