Handle bcrypt passwords for Mastodon migration

This commit is contained in:
Alex Gleason 2020-05-12 16:57:01 -05:00
commit 9cbf17d59f
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
4 changed files with 15 additions and 0 deletions

View 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