2017-12-28 13:59:22 +01:00
|
|
|
import { ServerInfo } from '../server/servers'
|
2019-07-11 17:23:24 +02:00
|
|
|
|
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
|
|
|
}
|