AccountController: Return scope in proper format.

This commit is contained in:
lain 2020-06-26 16:15:27 +02:00
commit f378e93bf4
3 changed files with 6 additions and 6 deletions

View file

@ -446,13 +446,13 @@ defmodule Pleroma.Web.ApiSpec.AccountOperation do
properties: %{
token_type: %Schema{type: :string},
access_token: %Schema{type: :string},
scope: %Schema{type: :array, items: %Schema{type: :string}},
scope: %Schema{type: :string},
created_at: %Schema{type: :integer, format: :"date-time"}
},
example: %{
"access_token" => "i9hAVVzGld86Pl5JtLtizKoXVvtTlSCJvwaugCxvZzk",
"created_at" => 1_585_918_714,
"scope" => ["read", "write", "follow", "push"],
"scope" => "read write follow push",
"token_type" => "Bearer"
}
}

View file

@ -104,7 +104,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do
json(conn, %{
token_type: "Bearer",
access_token: token.token,
scope: app.scopes,
scope: app.scopes |> Enum.join(" "),
created_at: Token.Utils.format_created_at(token)
})
else