projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Call ConfirmUserPlug from Router, not Endpoint
[akkoma]
/
lib
/
pleroma
/
web
/
plugs
/
user_enabled_plug.ex
diff --git
a/lib/pleroma/web/plugs/user_enabled_plug.ex
b/lib/pleroma/web/plugs/user_enabled_plug.ex
index fa28ee48b7179c0ffa661529f5392e30c4591091..4f1b163bd836980ef52011bad88a4e406d901f6b 100644
(file)
--- a/
lib/pleroma/web/plugs/user_enabled_plug.ex
+++ b/
lib/pleroma/web/plugs/user_enabled_plug.ex
@@
-3,7
+3,7
@@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Plugs.UserEnabledPlug do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Plugs.UserEnabledPlug do
- import Plug.Conn
+ alias Pleroma.Helpers.AuthHelper
alias Pleroma.User
def init(options) do
alias Pleroma.User
def init(options) do
@@
-11,9
+11,10
@@
defmodule Pleroma.Web.Plugs.UserEnabledPlug do
end
def call(%{assigns: %{user: %User{} = user}} = conn, _) do
end
def call(%{assigns: %{user: %User{} = user}} = conn, _) do
- case User.account_status(user) do
- :active -> conn
- _ -> assign(conn, :user, nil)
+ if User.account_status(user) == :active do
+ conn
+ else
+ AuthHelper.drop_auth_info(conn)
end
end
end
end