change cond to if else
This commit is contained in:
parent
1a8bc26e52
commit
8b020e03a6
|
@ -44,14 +44,10 @@ defp verify(nil, _password, _user_id) do
|
|||
end
|
||||
|
||||
defp verify(user, password, _user_id) do
|
||||
is_legacy = String.starts_with?(user.password_hash, "$6$")
|
||||
|
||||
valid =
|
||||
cond do
|
||||
is_legacy ->
|
||||
if String.starts_with?(user.password_hash, "$6$") do
|
||||
:crypt.crypt(password, user.password_hash) == user.password_hash
|
||||
|
||||
true ->
|
||||
else
|
||||
Pbkdf2.checkpw(password, user.password_hash)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue