Admin API: Return link alongside with token on password reset

This commit is contained in:
Maxim Filippov 2019-09-17 23:09:08 +03:00
commit f9dd121ad3
2 changed files with 7 additions and 1 deletions

View file

@ -432,9 +432,14 @@ 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)
|> json(%{
token: token.token,
link: "#{protocol}://#{host}/api/pleroma/password_reset/#{token}"
})
end
def list_reports(conn, params) do