mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-23 16:44:04 -05:00
32 lines
524 B
Ruby
32 lines
524 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
class OauthUserinfoSerializer < ActiveModel::Serializer
|
||
|
include RoutingHelper
|
||
|
|
||
|
attributes :iss, :sub, :name, :preferred_username, :profile, :picture
|
||
|
|
||
|
def iss
|
||
|
root_url
|
||
|
end
|
||
|
|
||
|
def sub
|
||
|
ActivityPub::TagManager.instance.uri_for(object)
|
||
|
end
|
||
|
|
||
|
def name
|
||
|
object.display_name
|
||
|
end
|
||
|
|
||
|
def preferred_username
|
||
|
object.username
|
||
|
end
|
||
|
|
||
|
def profile
|
||
|
ActivityPub::TagManager.instance.url_for(object)
|
||
|
end
|
||
|
|
||
|
def picture
|
||
|
full_asset_url(object.avatar_original_url)
|
||
|
end
|
||
|
end
|