aboutsummaryrefslogblamecommitdiffhomepage
path: root/shared/extra-utils/users/login.ts
blob: d0c26a4f0cd980cf8cfda9cd84f1468300775818 (plain) (tree)
1
2
3
4
5
6
7
8
                                              
 



                                                           
                                           
                                                                       








                                                                              
                          
 
import { ServerInfo } from '../server/servers'

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

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

  return Promise.all(tasks)
}

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

export {
  setAccessTokensToServers
}