mirror of
https://github.com/discourse/discourse.git
synced 2024-12-16 08:46:30 +08:00
SECURITY: rate limit user/password login
This commit is contained in:
parent
f02898f834
commit
48145e8e23
|
@ -51,6 +51,9 @@ class SessionController < ApplicationController
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
RateLimiter.new(nil, "login-hr-#{request.remote_ip}", 30, 1.hour).performed!
|
||||||
|
RateLimiter.new(nil, "login-min-#{request.remote_ip}", 6, 1.minute).performed!
|
||||||
|
|
||||||
params.require(:login)
|
params.require(:login)
|
||||||
params.require(:password)
|
params.require(:password)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user