Return the user's role in login and user blueprints (#133)
This commit is contained in:
parent
0cf1e629bf
commit
f8815043e6
2 changed files with 3 additions and 2 deletions
|
|
@ -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,
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue