aboutsummaryrefslogtreecommitdiffhomepage
path: root/packages/server-commands/src/users/login.ts
blob: c48c42c7205c9deb7d9480baec5f4148ce0296f4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { PeerTubeServer } from '../server/server.js'

function setAccessTokensToServers (servers: PeerTubeServer[]) {
  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
}