diff options
author | Alex Gleason <alex@alexgleason.me> | 2020-05-12 16:57:01 -0500 |
---|---|---|
committer | Alex Gleason <alex@alexgleason.me> | 2020-05-13 10:53:56 -0500 |
commit | 9cbf17d59fe34a760f8a4f94bc60f78b38ccba06 (patch) | |
tree | 42194b4459e9957b5111e70d5891575b9511bec8 /test | |
parent | da550be066a15108ceef7874c3b2549c049a7f88 (diff) | |
download | pleroma-9cbf17d59fe34a760f8a4f94bc60f78b38ccba06.tar.gz |
Handle bcrypt passwords for Mastodon migration
Diffstat (limited to 'test')
-rw-r--r-- | test/plugs/authentication_plug_test.exs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/plugs/authentication_plug_test.exs b/test/plugs/authentication_plug_test.exs index 31e20d726..c8ede71c0 100644 --- a/test/plugs/authentication_plug_test.exs +++ b/test/plugs/authentication_plug_test.exs @@ -79,6 +79,13 @@ defmodule Pleroma.Plugs.AuthenticationPlugTest do assert AuthenticationPlug.checkpw("password", hash) end + test "check bcrypt hash" do + hash = "$2a$10$uyhC/R/zoE1ndwwCtMusK.TLVzkQ/Ugsbqp3uXI.CTTz0gBw.24jS" + + assert AuthenticationPlug.checkpw("password", hash) + refute AuthenticationPlug.checkpw("password1", hash) + end + test "it returns false when hash invalid" do hash = "psBWV8gxkGOZWBz$PmfCycChoxeJ3GgGzwvhlgacb9mUoZ.KUXNCssekER4SJ7bOK53uXrHNb2e4i8yPFgSKyzaW9CcmrDXWIEMtD1" |