mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-12-29 03:53:55 +00:00
admin_api_controller.ex: Add documentation, fix get_invite_token
This commit is contained in:
parent
578a911737
commit
95b107b6cc
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue