diff options
author | Syldexia <syldexia@ofthewi.red> | 2018-05-21 22:17:34 +0100 |
---|---|---|
committer | Syldexia <syldexia@ofthewi.red> | 2018-05-21 23:06:03 +0100 |
commit | d0690622cdb885005444848a7db34bf89151e803 (patch) | |
tree | f6cd21ef588b0f22bf067a3dc948bb024fb3c249 /lib/pleroma/web/common_api/utils.ex | |
parent | b4064dfe30b792f5d6d36b72c7cd530afb1c667a (diff) | |
download | pleroma-d0690622cdb885005444848a7db34bf89151e803.tar.gz |
Added endpoint for changing passwords
Diffstat (limited to 'lib/pleroma/web/common_api/utils.ex')
-rw-r--r-- | lib/pleroma/web/common_api/utils.ex | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pleroma/web/common_api/utils.ex b/lib/pleroma/web/common_api/utils.ex index e774743a2..4ac45b592 100644 --- a/lib/pleroma/web/common_api/utils.ex +++ b/lib/pleroma/web/common_api/utils.ex @@ -187,9 +187,9 @@ defmodule Pleroma.Web.CommonAPI.Utils do end end - def confirm_current_password(user, params) do + def confirm_current_password(user, password) do with %User{local: true} = db_user <- Repo.get(User, user.id), - true <- Pbkdf2.checkpw(params["password"], db_user.password_hash) do + true <- Pbkdf2.checkpw(password, db_user.password_hash) do {:ok, db_user} else _ -> {:error, "Invalid password."} |