mirror of https://github.com/Chocobozzz/PeerTube
20 lines
473 B
TypeScript
20 lines
473 B
TypeScript
import { PeerTubeServer } from '../server/server'
|
|
|
|
function setAccessTokensToServers (servers: PeerTubeServer[]) {
|
|
const tasks: Promise<any>[] = []
|
|
|
|
for (const server of servers) {
|
|
const p = server.login.getAccessToken()
|
|
.then(t => { server.accessToken = t })
|
|
tasks.push(p)
|
|
}
|
|
|
|
return Promise.all(tasks)
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
export {
|
|
setAccessTokensToServers
|
|
}
|