forked from AkkomaGang/akkoma
admin_api_controller.ex: Add documentation, fix get_invite_token
This commit is contained in:
parent
578a911737
commit
95b107b6cc
1 changed files with 3 additions and 1 deletions
|
@ -55,13 +55,15 @@ def relay_unfollow(conn, %{relay_url: target}) do
|
||||||
|> send(200)
|
|> send(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@shortdoc "Get a account registeration invite token (base64 string)"
|
||||||
def get_invite_token(conn, _params) do
|
def get_invite_token(conn, _params) do
|
||||||
{:ok, token} <- Pleroma.UserInviteToken.create_token()
|
{:ok, token} <- Pleroma.UserInviteToken.create_token()
|
||||||
|
|
||||||
conn
|
conn
|
||||||
|> puts(token)
|
|> json(token.token)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@shortdoc "Get a password reset token (base64 string) for given nickname"
|
||||||
def get_password_reset(conn, %{"nickname" => nickname}) do
|
def get_password_reset(conn, %{"nickname" => nickname}) do
|
||||||
(%User{local: true} = user) = User.get_by_nickname(nickname)
|
(%User{local: true} = user) = User.get_by_nickname(nickname)
|
||||||
{:ok, token} = Pleroma.PasswordResetToken.create_token(user)
|
{:ok, token} = Pleroma.PasswordResetToken.create_token(user)
|
||||||
|
|
Loading…
Reference in a new issue