mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-30 09:02:28 +00:00
AccountController: Return scope in proper format.
This commit is contained in:
parent
6db9f7cdb3
commit
f378e93bf4
|
@ -446,13 +446,13 @@ defmodule Pleroma.Web.ApiSpec.AccountOperation do
|
||||||
properties: %{
|
properties: %{
|
||||||
token_type: %Schema{type: :string},
|
token_type: %Schema{type: :string},
|
||||||
access_token: %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"}
|
created_at: %Schema{type: :integer, format: :"date-time"}
|
||||||
},
|
},
|
||||||
example: %{
|
example: %{
|
||||||
"access_token" => "i9hAVVzGld86Pl5JtLtizKoXVvtTlSCJvwaugCxvZzk",
|
"access_token" => "i9hAVVzGld86Pl5JtLtizKoXVvtTlSCJvwaugCxvZzk",
|
||||||
"created_at" => 1_585_918_714,
|
"created_at" => 1_585_918_714,
|
||||||
"scope" => ["read", "write", "follow", "push"],
|
"scope" => "read write follow push",
|
||||||
"token_type" => "Bearer"
|
"token_type" => "Bearer"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,7 +104,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do
|
||||||
json(conn, %{
|
json(conn, %{
|
||||||
token_type: "Bearer",
|
token_type: "Bearer",
|
||||||
access_token: token.token,
|
access_token: token.token,
|
||||||
scope: app.scopes,
|
scope: app.scopes |> Enum.join(" "),
|
||||||
created_at: Token.Utils.format_created_at(token)
|
created_at: Token.Utils.format_created_at(token)
|
||||||
})
|
})
|
||||||
else
|
else
|
||||||
|
|
|
@ -905,7 +905,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
|
||||||
%{
|
%{
|
||||||
"access_token" => token,
|
"access_token" => token,
|
||||||
"created_at" => _created_at,
|
"created_at" => _created_at,
|
||||||
"scope" => _scope,
|
"scope" => ^scope,
|
||||||
"token_type" => "Bearer"
|
"token_type" => "Bearer"
|
||||||
} = json_response_and_validate_schema(conn, 200)
|
} = json_response_and_validate_schema(conn, 200)
|
||||||
|
|
||||||
|
@ -1067,7 +1067,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
|
||||||
assert %{
|
assert %{
|
||||||
"access_token" => access_token,
|
"access_token" => access_token,
|
||||||
"created_at" => _,
|
"created_at" => _,
|
||||||
"scope" => ["read", "write", "follow", "push"],
|
"scope" => "read write follow push",
|
||||||
"token_type" => "Bearer"
|
"token_type" => "Bearer"
|
||||||
} = response
|
} = response
|
||||||
|
|
||||||
|
@ -1185,7 +1185,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
|
||||||
assert %{
|
assert %{
|
||||||
"access_token" => access_token,
|
"access_token" => access_token,
|
||||||
"created_at" => _,
|
"created_at" => _,
|
||||||
"scope" => ["read"],
|
"scope" => "read",
|
||||||
"token_type" => "Bearer"
|
"token_type" => "Bearer"
|
||||||
} =
|
} =
|
||||||
conn
|
conn
|
||||||
|
|
Loading…
Reference in a new issue