aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMoon Man <shitposterclub@gmail.com>2018-09-05 01:37:48 -0400
committerMoon Man <shitposterclub@gmail.com>2018-09-05 01:37:48 -0400
commit8b020e03a699beb24d054108cf027b3fbbab2267 (patch)
treed53f6e0fdc9fd74aa98433bb425ad975273b12d8 /lib
parent1a8bc26e52745909d6fc9ca7d04098d0dd247cfa (diff)
downloadpleroma-8b020e03a699beb24d054108cf027b3fbbab2267.tar.gz
change cond to if else
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/plugs/authentication_plug.ex12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/pleroma/plugs/authentication_plug.ex b/lib/pleroma/plugs/authentication_plug.ex
index 616d31df4..ffecb403d 100644
--- 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