Add userinfo oauth endpoint (#32548)
This commit is contained in:
parent
0a599d08d8
commit
e1b7382ea6
8 changed files with 112 additions and 12 deletions
31
app/serializers/oauth_userinfo_serializer.rb
Normal file
31
app/serializers/oauth_userinfo_serializer.rb
Normal file
|
@ -0,0 +1,31 @@
|
|||
# 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
|
Loading…
Add table
Add a link
Reference in a new issue