Handle bcrypt passwords for Mastodon migration
[akkoma] / lib / pleroma / plugs / authentication_plug.ex
index ae4a235bdcd0a8e8b32e25c0c3ef32efd2f44721..1994b807e80d01c5fbee112ad16e2d2f775ca5fd 100644 (file)
@@ -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