aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMaxim Filippov <colixer@gmail.com>2019-09-22 16:36:59 +0300
committerMaxim Filippov <colixer@gmail.com>2019-09-22 16:36:59 +0300
commit72a01f1350239d286978007883a087f8f3985d1b (patch)
treeb6758f16f8fbf8a9f5617bebaf5fd93718b38650 /lib
parent384b7dd40dd484146d267ba4e12f750184365bfc (diff)
downloadpleroma-72a01f1350239d286978007883a087f8f3985d1b.tar.gz
Use router helper to generate reset password link
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/admin_api/admin_api_controller.ex6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/pleroma/web/admin_api/admin_api_controller.ex b/lib/pleroma/web/admin_api/admin_api_controller.ex
index 54ab6e032..b2df1e5b8 100644
--- a/lib/pleroma/web/admin_api/admin_api_controller.ex
+++ b/lib/pleroma/web/admin_api/admin_api_controller.ex
@@ -17,7 +17,9 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do
alias Pleroma.Web.AdminAPI.ReportView
alias Pleroma.Web.AdminAPI.Search
alias Pleroma.Web.CommonAPI
+ alias Pleroma.Web.Endpoint
alias Pleroma.Web.MastodonAPI.StatusView
+ alias Pleroma.Web.Router
import Pleroma.Web.ControllerHelper, only: [json_response: 3]
@@ -432,13 +434,11 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do
def get_password_reset(conn, %{"nickname" => nickname}) do
(%User{local: true} = user) = User.get_cached_by_nickname(nickname)
{:ok, token} = Pleroma.PasswordResetToken.create_token(user)
- host = Pleroma.Config.get([Pleroma.Web.Endpoint, :url, :host])
- protocol = Pleroma.Config.get([Pleroma.Web.Endpoint, :protocol])
conn
|> json(%{
token: token.token,
- link: "#{protocol}://#{host}/api/pleroma/password_reset/#{token.token}"
+ link: Router.Helpers.reset_password_url(Endpoint, :reset, token.token)
})
end