PeerTube/shared/extra-utils/users/login.ts

20 lines
473 B
TypeScript
Raw Normal View History

2017-12-28 13:59:22 +01:00
import { ServerInfo } from '../server/servers'
2017-09-04 21:21:47 +02:00
function setAccessTokensToServers (servers: ServerInfo[]) {
const tasks: Promise<any>[] = []
for (const server of servers) {
2021-07-13 11:05:15 +02:00
const p = server.loginCommand.getAccessToken()
.then(t => { server.accessToken = t })
2017-09-04 21:21:47 +02:00
tasks.push(p)
}
return Promise.all(tasks)
}
// ---------------------------------------------------------------------------
export {
2021-07-13 11:05:15 +02:00
setAccessTokensToServers
2017-09-04 21:21:47 +02:00
}