diaspora/app/serializers/user_info_serializer.rb
theworldbright d834a1d4d0 Replace user info endpoint with supported claims
The route /api/v0/user/ will now be used as a
non-OIDC route. In other words, the /api/v0/user/
will require the "read" scope while
/api/openid_connect/user_info/ will require the
"openid" scope
2016-01-04 16:49:51 +09:00

23 lines
443 B
Ruby

class UserInfoSerializer < ActiveModel::Serializer
attributes :sub, :nickname, :profile, :picture, :zoneinfo
def sub
object.diaspora_handle # TODO: Change to proper sub
end
def nickname
object.name
end
def profile
File.join(AppConfig.environment.url, "people", object.guid).to_s
end
def picture
File.join(AppConfig.environment.url, object.image_url).to_s
end
def zoneinfo
object.language
end
end