New rate limiter
This commit is contained in:
parent
7438c177d9
commit
94627baa5c
16 changed files with 464 additions and 274 deletions
|
|
@ -10,8 +10,8 @@ defmodule Pleroma.Web.MongooseIM.MongooseIMController do
|
|||
alias Pleroma.Repo
|
||||
alias Pleroma.User
|
||||
|
||||
plug(RateLimiter, :authentication when action in [:user_exists, :check_password])
|
||||
plug(RateLimiter, {:authentication, params: ["user"]} when action == :check_password)
|
||||
plug(RateLimiter, [name: :authentication] when action in [:user_exists, :check_password])
|
||||
plug(RateLimiter, [name: :authentication, params: ["user"]] when action == :check_password)
|
||||
|
||||
def user_exists(conn, %{"user" => username}) do
|
||||
with %User{} <- Repo.get_by(User, nickname: username, local: true) do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue