Return the user's role in login and user blueprints

This commit is contained in:
Justin Edmund 2023-09-09 02:27:22 -07:00
parent 0cf1e629bf
commit 8f03b329bd
2 changed files with 3 additions and 2 deletions

View file

@ -4,7 +4,7 @@ module Api
module V1 module V1
class UserBlueprint < ApiBlueprint class UserBlueprint < ApiBlueprint
view :minimal do view :minimal do
fields :username, :language, :private, :gender, :theme fields :username, :language, :private, :gender, :theme, :role
field :avatar do |user| field :avatar do |user|
{ {
picture: user.picture, picture: user.picture,

View file

@ -25,7 +25,8 @@ class TokensController < Doorkeeper::TokensController
### Or if you want to just append user using 'as_json' ### Or if you want to just append user using 'as_json'
body[:user] = { body[:user] = {
id: user.id, id: user.id,
username: user.username username: user.username,
role: user.role
} }
end end