mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-18 10:59:17 +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 @@ 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)
|
||||
|
|
Loading…
Reference in a new issue