summaryrefslogtreecommitdiff
path: root/test/plugs/authentication_plug_test.exs
diff options
context:
space:
mode:
authorIvan Tashkinov <ivantashkinov@gmail.com>2020-05-14 20:19:56 +0300
committerIvan Tashkinov <ivantashkinov@gmail.com>2020-05-14 20:19:56 +0300
commite4b12494d77e7a6920a408d62d5b8fe0f886a14d (patch)
tree5b58e0cfaf33dc2fccd809e887e1194baa6b1191 /test/plugs/authentication_plug_test.exs
parentf1f588fd5271c0b3bf09df002a83dbb57c42bae0 (diff)
parente455ca3f3eee74db0b1e60550acf53bea915be3b (diff)
downloadpleroma-e4b12494d77e7a6920a408d62d5b8fe0f886a14d.tar.gz
pleroma-e4b12494d77e7a6920a408d62d5b8fe0f886a14d.zip
Merge remote-tracking branch 'remotes/origin/develop' into 2168-media-preview-proxy
# Conflicts: # mix.lock
Diffstat (limited to 'test/plugs/authentication_plug_test.exs')
-rw-r--r--test/plugs/authentication_plug_test.exs9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/plugs/authentication_plug_test.exs b/test/plugs/authentication_plug_test.exs
index 646bda9d3..c8ede71c0 100644
--- a/test/plugs/authentication_plug_test.exs
+++ b/test/plugs/authentication_plug_test.exs
@@ -16,7 +16,7 @@ defmodule Pleroma.Plugs.AuthenticationPlugTest do
user = %User{
id: 1,
name: "dude",
- password_hash: Comeonin.Pbkdf2.hashpwsalt("guy")
+ password_hash: Pbkdf2.hash_pwd_salt("guy")
}
conn =
@@ -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"