From: Haelwenn (lanodan) Monnier Date: Fri, 12 Oct 2018 04:37:37 +0000 (+0200) Subject: admin_api_controller.ex: Add documentation, fix get_invite_token X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=95b107b6ccdca0413ec205525ac308dc4ee9e173;p=akkoma admin_api_controller.ex: Add documentation, fix get_invite_token --- 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)