projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Do not want these interfering with develop builds
[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..1142a8dbcffd85417e22942b65b3708d18021c98 100644
(file)
--- a/
lib/pleroma/web/plugs/user_enabled_plug.ex
+++ b/
lib/pleroma/web/plugs/user_enabled_plug.ex
@@
-1,9
+1,9
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-202
0
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-202
1
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
# 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