login.ts 473 B

12345678910111213141516171819
  1. import { PeerTubeServer } from '../server/server'
  2. function setAccessTokensToServers (servers: PeerTubeServer[]) {
  3. const tasks: Promise<any>[] = []
  4. for (const server of servers) {
  5. const p = server.login.getAccessToken()
  6. .then(t => { server.accessToken = t })
  7. tasks.push(p)
  8. }
  9. return Promise.all(tasks)
  10. }
  11. // ---------------------------------------------------------------------------
  12. export {
  13. setAccessTokensToServers
  14. }