mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FIX: Don't throttle local lookups
This commit is contained in:
parent
016b9cd0e9
commit
8c04893a04
1 changed files with 1 additions and 1 deletions
|
@ -48,7 +48,7 @@ class Auth::DefaultCurrentUserProvider
|
||||||
if auth_token && auth_token.length == 32
|
if auth_token && auth_token.length == 32
|
||||||
limiter = RateLimiter.new(nil, "cookie_auth_#{request.ip}", COOKIE_ATTEMPTS_PER_MIN , 60)
|
limiter = RateLimiter.new(nil, "cookie_auth_#{request.ip}", COOKIE_ATTEMPTS_PER_MIN , 60)
|
||||||
|
|
||||||
if limiter.can_perform?
|
if request.ip == "127.0.0.1" || request.ip == "::1" || limiter.can_perform?
|
||||||
@user_token = UserAuthToken.lookup(auth_token,
|
@user_token = UserAuthToken.lookup(auth_token,
|
||||||
seen: true,
|
seen: true,
|
||||||
user_agent: @env['HTTP_USER_AGENT'],
|
user_agent: @env['HTTP_USER_AGENT'],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue