activitypub: user view: do not expose oAuth endpoints for instance users
This commit is contained in:
parent
d54c483964
commit
64620d8980
2 changed files with 16 additions and 1 deletions
|
|
@ -17,7 +17,11 @@ defmodule Pleroma.Web.ActivityPub.UserView do
|
|||
|
||||
import Ecto.Query
|
||||
|
||||
def render("endpoints.json", %{user: %User{nickname: _nickname, local: true} = _user}) do
|
||||
def render("endpoints.json", %{user: %User{nickname: nil, local: true} = _user}) do
|
||||
%{"sharedInbox" => Helpers.activity_pub_url(Endpoint, :inbox)}
|
||||
end
|
||||
|
||||
def render("endpoints.json", %{user: %User{local: true} = _user}) do
|
||||
%{
|
||||
"oauthAuthorizationEndpoint" => Helpers.o_auth_url(Endpoint, :authorize),
|
||||
"oauthRegistrationEndpoint" => Helpers.mastodon_api_url(Endpoint, :create_app),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue