summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormarcin mikołajczak <git@mkljczk.pl>2024-09-08 05:23:46 +0300
committerMint <mint@plagu.ee>2024-09-08 05:23:46 +0300
commitc9b28eaf9a484fa1f2c27d00855c997575369782 (patch)
treeaea61b84923262a7d0a7145615258f4dc2ff7a19 /lib
parentbb0cb06d8a3a9e97d3b39d712ee5a7147c25ee84 (diff)
downloadpleroma-c9b28eaf9a484fa1f2c27d00855c997575369782.tar.gz
pleroma-c9b28eaf9a484fa1f2c27d00855c997575369782.zip
Argon2 password support
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/plugs/authentication_plug.ex4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/pleroma/web/plugs/authentication_plug.ex b/lib/pleroma/web/plugs/authentication_plug.ex
index f912a1542..3fc6e7b51 100644
--- a/lib/pleroma/web/plugs/authentication_plug.ex
+++ b/lib/pleroma/web/plugs/authentication_plug.ex
@@ -47,6 +47,10 @@ defmodule Pleroma.Web.Plugs.AuthenticationPlug do
Pleroma.Password.Pbkdf2.verify_pass(password, password_hash)
end
+ def checkpw(password, "$argon2" <> _ = password_hash) do
+ Argon2.verify_pass(password, password_hash)
+ end
+
def checkpw(_password, _password_hash) do
Logger.error("Password hash not recognized")
false