aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/common_api
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2018-05-26 16:00:59 +0200
committerlain <lain@soykaf.club>2018-05-26 16:00:59 +0200
commit4b3ec5351466f8615b32e62cc4e6215f8a80b105 (patch)
treee46842eac5d8255858a113f71bdf42bfd75e4436 /lib/pleroma/web/common_api
parent4fd9df100f61dfe4731934eca86500472d866f60 (diff)
parent6138b297836f459e4fe5d21dfed30ddd9397b6d4 (diff)
downloadpleroma-4b3ec5351466f8615b32e62cc4e6215f8a80b105.tar.gz
Merge branch 'develop' into csaurus/pleroma-feature/mstdn-direct-api
Diffstat (limited to 'lib/pleroma/web/common_api')
-rw-r--r--lib/pleroma/web/common_api/utils.ex6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/pleroma/web/common_api/utils.ex b/lib/pleroma/web/common_api/utils.ex
index e774743a2..9c9951371 100644
--- a/lib/pleroma/web/common_api/utils.ex
+++ b/lib/pleroma/web/common_api/utils.ex
@@ -133,7 +133,7 @@ defmodule Pleroma.Web.CommonAPI.Utils do
"context" => context,
"attachment" => attachments,
"actor" => actor,
- "tag" => tags |> Enum.map(fn {_, tag} -> tag end)
+ "tag" => tags |> Enum.map(fn {_, tag} -> tag end) |> Enum.uniq()
}
if inReplyTo do
@@ -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."}