diff options
author | lain <lain@soykaf.club> | 2020-05-15 13:33:04 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-05-15 13:33:04 +0200 |
commit | f012c3a202ef43d1a8a1dc88f08057b7a41d3d78 (patch) | |
tree | a3847182efa357bce56c12d6253492dc0cc2b894 /test/plugs/authentication_plug_test.exs | |
parent | 1d18721a3c60aa0acc7d1ba858a92277e544a54a (diff) | |
parent | 081d1d3f48f2264ee329f7ff7af7c2f88fe0a654 (diff) | |
download | pleroma-f012c3a202ef43d1a8a1dc88f08057b7a41d3d78.tar.gz |
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into remake-remodel-dms
Diffstat (limited to 'test/plugs/authentication_plug_test.exs')
-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" |