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 23e800a74740c6c3ccee0d130400857522985ba4..4f1b163bd836980ef52011bad88a4e406d901f6b 100644
(file)
--- a/
lib/pleroma/web/plugs/user_enabled_plug.ex
+++ b/
lib/pleroma/web/plugs/user_enabled_plug.ex
@@
-2,8
+2,8
@@
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
-defmodule Pleroma.Plugs.UserEnabledPlug do
- import Plug.Conn
+defmodule Pleroma.
Web.
Plugs.UserEnabledPlug do
+ alias Pleroma.Helpers.AuthHelper
alias Pleroma.User
def init(options) do
alias Pleroma.User
def init(options) do
@@
-11,9
+11,10
@@
defmodule Pleroma.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