1
0
Fork 0
peertube/shared/extra-utils/users/login.ts
2021-07-20 15:27:18 +02:00

19 lines
466 B
TypeScript

import { ServerInfo } from '../server/servers'
function setAccessTokensToServers (servers: ServerInfo[]) {
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
}