mirror of
https://github.com/discourse/discourse.git
synced 2025-09-05 08:59:27 +08:00
FIX: rate limit password reset email
This commit is contained in:
parent
582ec5954f
commit
e0a82d3088
5 changed files with 38 additions and 14 deletions
|
@ -19,7 +19,7 @@ class RateLimiter
|
|||
|
||||
def initialize(user, key, max, secs)
|
||||
@user = user
|
||||
@key = "l-rate-limit:#{@user.id}:#{key}"
|
||||
@key = "l-rate-limit:#{@user && @user.id}:#{key}"
|
||||
@max = max
|
||||
@secs = secs
|
||||
end
|
||||
|
@ -71,6 +71,6 @@ class RateLimiter
|
|||
end
|
||||
|
||||
def rate_unlimited?
|
||||
!!(RateLimiter.disabled? || @user.staff?)
|
||||
!!(RateLimiter.disabled? || (@user && @user.staff?))
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue