checkPasswordChangeRateLimit
Function: checkPasswordChangeRateLimit()
checkPasswordChangeRateLimit(
cache,userId,logger,config?):Promise<void>
Defined in: src/utilities/passwordChangeRateLimit.ts:49
Checks if a user has exceeded the rate limit for password changes. Uses Redis via CacheService with a fixed time window.
Parameters
cache
The cache instance (Redis-backed)
userId
string
The user ID to check
logger
Logger for violation logging
config?
Optional configurable limits
Returns
Promise<void>
Throws
TalawaGraphQLError with code "too_many_requests" and httpStatus 429