1
0
Fork 0
peertube/shared/server-commands/users/login.ts

20 lines
473 B
TypeScript
Raw Normal View History

2021-07-16 03:47:51 -04:00
import { PeerTubeServer } from '../server/server'
2021-07-16 03:47:51 -04:00
function setAccessTokensToServers (servers: PeerTubeServer[]) {
2017-09-04 15:21:47 -04:00
const tasks: Promise<any>[] = []
for (const server of servers) {
2021-07-16 03:04:35 -04:00
const p = server.login.getAccessToken()
2021-07-13 05:05:15 -04:00
.then(t => { server.accessToken = t })
2017-09-04 15:21:47 -04:00
tasks.push(p)
}
return Promise.all(tasks)
}
// ---------------------------------------------------------------------------
export {
2021-07-13 05:05:15 -04:00
setAccessTokensToServers
2017-09-04 15:21:47 -04:00
}