From 95b107b6ccdca0413ec205525ac308dc4ee9e173 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 12 Oct 2018 06:37:37 +0200 Subject: [PATCH] admin_api_controller.ex: Add documentation, fix get_invite_token --- lib/pleroma/web/admin_api/admin_api_controller.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/pleroma/web/admin_api/admin_api_controller.ex b/lib/pleroma/web/admin_api/admin_api_controller.ex index 0cc84430d..7ef60b1f4 100644 --- a/lib/pleroma/web/admin_api/admin_api_controller.ex +++ b/lib/pleroma/web/admin_api/admin_api_controller.ex @@ -55,13 +55,15 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do |> send(200) end + @shortdoc "Get a account registeration invite token (base64 string)" def get_invite_token(conn, _params) do {:ok, token} <- Pleroma.UserInviteToken.create_token() conn - |> puts(token) + |> json(token.token) end + @shortdoc "Get a password reset token (base64 string) for given nickname" def get_password_reset(conn, %{"nickname" => nickname}) do (%User{local: true} = user) = User.get_by_nickname(nickname) {:ok, token} = Pleroma.PasswordResetToken.create_token(user) -- 2.45.2