Return token's primary key with POST /oauth/token

This commit is contained in:
Alex Gleason 2021-03-24 12:50:05 -05:00
commit b6a69b5efd
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
3 changed files with 27 additions and 4 deletions

View file

@ -805,10 +805,12 @@ defmodule Pleroma.Web.OAuth.OAuthControllerTest do
"client_secret" => app.client_secret
})
assert %{"access_token" => token} = json_response(conn, 200)
assert %{"id" => id, "access_token" => access_token} = json_response(conn, 200)
token = Repo.get_by(Token, token: token)
token = Repo.get_by(Token, token: access_token)
assert token
assert token.id == id
assert token.token == access_token
assert token.scopes == app.scopes
end