projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1a8bc26
)
change cond to if else
author
Moon Man
<shitposterclub@gmail.com>
Wed, 5 Sep 2018 05:37:48 +0000
(
01:37
-0400)
committer
Moon Man
<shitposterclub@gmail.com>
Wed, 5 Sep 2018 05:37:48 +0000
(
01:37
-0400)
lib/pleroma/plugs/authentication_plug.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/plugs/authentication_plug.ex
b/lib/pleroma/plugs/authentication_plug.ex
index 616d31df4ba7a2f080e951c1ff6f598e7efc8008..ffecb403d6bf246ea528888420c2f3ca33544d95 100644
(file)
--- a/
lib/pleroma/plugs/authentication_plug.ex
+++ b/
lib/pleroma/plugs/authentication_plug.ex
@@
-44,15
+44,11
@@
defmodule Pleroma.Plugs.AuthenticationPlug do
end
defp verify(user, password, _user_id) do
- is_legacy = String.starts_with?(user.password_hash, "$6$")
-
valid =
- cond do
- is_legacy ->
- :crypt.crypt(password, user.password_hash) == user.password_hash
-
- true ->
- Pbkdf2.checkpw(password, user.password_hash)
+ if String.starts_with?(user.password_hash, "$6$") do
+ :crypt.crypt(password, user.password_hash) == user.password_hash
+ else
+ Pbkdf2.checkpw(password, user.password_hash)
end
if valid do