aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/plugs/authentication_plug.ex
diff options
context:
space:
mode:
authorAlex Gleason <alex@alexgleason.me>2020-05-12 16:57:01 -0500
committerAlex Gleason <alex@alexgleason.me>2020-05-13 10:53:56 -0500
commit9cbf17d59fe34a760f8a4f94bc60f78b38ccba06 (patch)
tree42194b4459e9957b5111e70d5891575b9511bec8 /lib/pleroma/plugs/authentication_plug.ex
parentda550be066a15108ceef7874c3b2549c049a7f88 (diff)
downloadpleroma-9cbf17d59fe34a760f8a4f94bc60f78b38ccba06.tar.gz
Handle bcrypt passwords for Mastodon migration
Diffstat (limited to 'lib/pleroma/plugs/authentication_plug.ex')
-rw-r--r--lib/pleroma/plugs/authentication_plug.ex5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/pleroma/plugs/authentication_plug.ex b/lib/pleroma/plugs/authentication_plug.ex
index ae4a235bd..1994b807e 100644
--- a/lib/pleroma/plugs/authentication_plug.ex
+++ b/lib/pleroma/plugs/authentication_plug.ex
@@ -16,6 +16,11 @@ defmodule Pleroma.Plugs.AuthenticationPlug do
:crypt.crypt(password, password_hash) == password_hash
end
+ def checkpw(password, "$2" <> _ = password_hash) do
+ # Handle bcrypt passwords for Mastodon migration
+ Bcrypt.verify_pass(password, password_hash)
+ end
+
def checkpw(password, "$pbkdf2" <> _ = password_hash) do
Pbkdf2.verify_pass(password, password_hash)
end