mirror of
https://github.com/PretendoNetwork/account.git
synced 2026-07-15 08:11:06 -05:00
11 lines
298 B
JavaScript
11 lines
298 B
JavaScript
const crypto = require('crypto');
|
|
const ratelimit = require('express-rate-limit');
|
|
|
|
module.exports = ratelimit({
|
|
windowMs: 60 * 1000,
|
|
max: 1,
|
|
keyGenerator: request => {
|
|
const data = request.headers['x-nintendo-device-cert'];
|
|
return crypto.createHash('md5').update(data).digest('hex');
|
|
}
|
|
}); |