PeerTube/shared/server-commands/users/login.ts

20 lines
473 B
TypeScript
Raw Normal View History

2021-07-16 09:47:51 +02:00
import { PeerTubeServer } from '../server/server'
2021-07-16 09:47:51 +02:00
function setAccessTokensToServers (servers: PeerTubeServer[]) {
2017-09-04 21:21:47 +02:00
const tasks: Promise<any>[] = []
for (const server of servers) {
2021-07-16 09:04:35 +02:00
const p = server.login.getAccessToken()
2021-07-13 11:05:15 +02:00
.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
}