mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 02:09:37 +02:00
Cleanup
We must not expose private actor objects to clients Just make 2 GET requests on channel/accounts instead
This commit is contained in:
parent
d6d96bed80
commit
012580d98f
21 changed files with 221 additions and 397 deletions
|
@ -208,14 +208,12 @@ class ClientHtml {
|
|||
}
|
||||
|
||||
static async getActorHTMLPage (nameWithHost: string, req: express.Request, res: express.Response) {
|
||||
const accountModel = await AccountModel.loadByNameWithHost(nameWithHost)
|
||||
const [ account, channel ] = await Promise.all([
|
||||
AccountModel.loadByNameWithHost(nameWithHost),
|
||||
VideoChannelModel.loadByNameWithHostAndPopulateAccount(nameWithHost)
|
||||
])
|
||||
|
||||
if (accountModel) {
|
||||
return this.getAccountOrChannelHTMLPage(() => new Promise(resolve => resolve(accountModel)), req, res)
|
||||
} else {
|
||||
const videoChannelModelPromise = VideoChannelModel.loadByNameWithHostAndPopulateAccount(nameWithHost)
|
||||
return this.getAccountOrChannelHTMLPage(() => videoChannelModelPromise, req, res)
|
||||
}
|
||||
return this.getAccountOrChannelHTMLPage(() => Promise.resolve(account || channel), req, res)
|
||||
}
|
||||
|
||||
static async getEmbedHTML () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue