]>
git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/tests/real-world/tools/get-access-token.js
3 const program
= require('commander')
5 const utils
= require('../../api/utils')
8 .option('-u, --url <url>', 'Server url')
9 .option('-n, --username <username>', 'Username')
10 .option('-p, --password <token>', 'Password')
18 throw new Error('All arguments are required.')
24 username: program
.username
,
25 password: program
.password
33 utils
.getClient(program
.url
, function (err
, res
) {
36 server
.client
.id
= res
.body
.client_id
37 server
.client
.secret
= res
.body
.client_secret
39 utils
.loginAndGetAccessToken(server
, function (err
, accessToken
) {
42 console
.log(accessToken
)