projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ActivityPub MRF: implement the SimplePolicy policy
[akkoma]
/
lib
/
pleroma
/
plugs
/
authentication_plug.ex
diff --git
a/lib/pleroma/plugs/authentication_plug.ex
b/lib/pleroma/plugs/authentication_plug.ex
index 4794e625a566b3703b54e97e1747fba476fb9304..86a514541025083c33adec55dda58bb48d0c29f6 100644
(file)
--- a/
lib/pleroma/plugs/authentication_plug.ex
+++ b/
lib/pleroma/plugs/authentication_plug.ex
@@
-14,8
+14,7
@@
defmodule Pleroma.Plugs.AuthenticationPlug do
{:ok, user} <- opts[:fetcher].(username),
false <- !!user.info["deactivated"],
saved_user_id <- get_session(conn, :user_id),
{:ok, user} <- opts[:fetcher].(username),
false <- !!user.info["deactivated"],
saved_user_id <- get_session(conn, :user_id),
- {:ok, verified_user} <- verify(user, password, saved_user_id)
- do
+ {:ok, verified_user} <- verify(user, password, saved_user_id) do
conn
|> assign(:user, verified_user)
|> put_session(:user_id, verified_user.id)
conn
|> assign(:user, verified_user)
|> put_session(:user_id, verified_user.id)
@@
-30,7
+29,7
@@
defmodule Pleroma.Plugs.AuthenticationPlug do
end
defp verify(nil, _password, _user_id) do
end
defp verify(nil, _password, _user_id) do
- Pbkdf2.dummy_checkpw
+ Pbkdf2.dummy_checkpw
()
:error
end
:error
end
@@
-45,8
+44,7
@@
defmodule Pleroma.Plugs.AuthenticationPlug do
defp decode_header(conn) do
with ["Basic " <> header] <- get_req_header(conn, "authorization"),
{:ok, userinfo} <- Base.decode64(header),
defp decode_header(conn) do
with ["Basic " <> header] <- get_req_header(conn, "authorization"),
{:ok, userinfo} <- Base.decode64(header),
- [username, password] <- String.split(userinfo, ":", parts: 2)
- do
+ [username, password] <- String.split(userinfo, ":", parts: 2) do
{:ok, username, password}
end
end
{:ok, username, password}
end
end