diff options
author | lain <lain@soykaf.club> | 2020-05-14 14:36:56 +0000 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-05-14 14:36:56 +0000 |
commit | 4157c459b8f7ef1c4203338f2fae34aa18c77933 (patch) | |
tree | 9538c96a6ea1c3d171058e6d1d16eb876073f2cb /test | |
parent | a2a8c8e9e09b3aa5bc488a958a0afe5909a6e89c (diff) | |
parent | 5b0f27d23d8f60d2e12c0556c56fdb52809398eb (diff) | |
download | pleroma-4157c459b8f7ef1c4203338f2fae34aa18c77933.tar.gz |
Merge branch 'bcrypt-auth' into 'develop'
Handle bcrypt passwords for Mastodon migration
See merge request pleroma/pleroma!2527
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" |