admin_api_controller.ex: Add documentation, fix get_invite_token

This commit is contained in:
Haelwenn (lanodan) Monnier 2018-10-12 06:37:37 +02:00
parent 578a911737
commit 95b107b6cc
No known key found for this signature in database
GPG key ID: D5B7A8E43C997DEE

View file

@ -55,13 +55,15 @@ def relay_unfollow(conn, %{relay_url: target}) 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)