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


                                  
                                           
                                                                       








                                                                              
                          
 
import { PeerTubeServer } from '../server/server'

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
}