aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/users/login.ts
blob: d4ee8e517cd1006c80c1793988ac67674259096d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { ServerInfo } from '../server/servers'

function setAccessTokensToServers (servers: ServerInfo[]) {
  const tasks: Promise<any>[] = []

  for (const server of servers) {
    const p = server.loginCommand.getAccessToken()
                                 .then(t => { server.accessToken = t })
    tasks.push(p)
  }

  return Promise.all(tasks)
}

// ---------------------------------------------------------------------------

export {
  setAccessTokensToServers
}