projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Pleroma.Web.ActivityPub.Utils: Use locally-served JSON-LD Litepub context instead...
[akkoma]
/
lib
/
pleroma
/
plugs
/
legacy_authentication_plug.ex
diff --git
a/lib/pleroma/plugs/legacy_authentication_plug.ex
b/lib/pleroma/plugs/legacy_authentication_plug.ex
index 48c0aba8825989aed635062d62439c7e4046e209..d22c1a647e7d771c09f2d7e982cc1b732084a43b 100644
(file)
--- a/
lib/pleroma/plugs/legacy_authentication_plug.ex
+++ b/
lib/pleroma/plugs/legacy_authentication_plug.ex
@@
-17,11
+17,15
@@
defmodule Pleroma.Plugs.LegacyAuthenticationPlug do
} = conn,
_
) do
} = conn,
_
) do
- if :crypt.crypt(password, password_hash) == password_hash do
+ with ^password_hash <- :crypt.crypt(password, password_hash),
+ {:ok, user} <-
+ User.reset_password(auth_user, %{password: password, password_confirmation: password}) do
conn
conn
- |> assign(:user, auth_user)
+ |> assign(:auth_user, user)
+ |> assign(:user, user)
else
else
- conn
+ _ ->
+ conn
end
end
end
end