Change pins to alphanumeric
This commit is contained in:
parent
a5f2f19898
commit
bfcc33cc50
3 changed files with 65 additions and 32 deletions
|
|
@ -14,6 +14,14 @@ const gameCreationLimiter = rateLimit({
|
|||
message: { error: 'Too many game creations, please try again later.' },
|
||||
});
|
||||
|
||||
const gameLookupLimiter = rateLimit({
|
||||
windowMs: 60 * 1000,
|
||||
max: isDev ? 500 : 100,
|
||||
standardHeaders: true,
|
||||
legacyHeaders: false,
|
||||
message: { error: 'Too many requests, please try again later.' },
|
||||
});
|
||||
|
||||
const SESSION_TTL_MINUTES = parseInt(process.env.GAME_SESSION_TTL_MINUTES || '5', 10);
|
||||
|
||||
interface GameSession {
|
||||
|
|
@ -71,7 +79,7 @@ router.post('/', gameCreationLimiter, (req: Request, res: Response) => {
|
|||
}
|
||||
});
|
||||
|
||||
router.get('/:pin', (req: Request, res: Response) => {
|
||||
router.get('/:pin', gameLookupLimiter, (req: Request, res: Response) => {
|
||||
try {
|
||||
const { pin } = req.params;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue