mirror of
https://github.com/sasjs/server.git
synced 2026-01-11 16:20:06 +00:00
chore: move secondsToHms to @sasjs/utils
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { RequestHandler } from 'express'
|
||||
import { RateLimiter, secondsToHms } from '../utils'
|
||||
import { convertSecondsToHms } from '@sasjs/utils'
|
||||
import { RateLimiter } from '../utils'
|
||||
|
||||
export const bruteForceProtection: RequestHandler = async (req, res, next) => {
|
||||
const ip = req.ip
|
||||
@@ -12,7 +13,7 @@ export const bruteForceProtection: RequestHandler = async (req, res, next) => {
|
||||
if (retrySecs > 0) {
|
||||
res
|
||||
.status(429)
|
||||
.send(`Too Many Requests! Retry after ${secondsToHms(retrySecs)}`)
|
||||
.send(`Too Many Requests! Retry after ${convertSecondsToHms(retrySecs)}`)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user