aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tools/peertube-get-access-token.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-06-13 11:09:38 +0200
committerChocobozzz <me@florianbigard.com>2019-06-13 11:09:38 +0200
commit1a12f66d631d28a5a58ebbcd274426f2e6e5d203 (patch)
treeedaf546dfc8bcdb55d271111618e65569aa68cc0 /server/tools/peertube-get-access-token.ts
parent4913295f9db1a7b814129d90b159a418cb32bb75 (diff)
downloadPeerTube-1a12f66d631d28a5a58ebbcd274426f2e6e5d203.tar.gz
PeerTube-1a12f66d631d28a5a58ebbcd274426f2e6e5d203.tar.zst
PeerTube-1a12f66d631d28a5a58ebbcd274426f2e6e5d203.zip
Add more CLI tests
Diffstat (limited to 'server/tools/peertube-get-access-token.ts')
-rw-r--r--server/tools/peertube-get-access-token.ts18
1 files changed, 6 insertions, 12 deletions
diff --git a/server/tools/peertube-get-access-token.ts b/server/tools/peertube-get-access-token.ts
index 85660de2c..103495347 100644
--- a/server/tools/peertube-get-access-token.ts
+++ b/server/tools/peertube-get-access-token.ts
@@ -1,12 +1,5 @@
1import * as program from 'commander' 1import * as program from 'commander'
2 2import { getClient, Server, serverLogin } from '../../shared/extra-utils'
3import {
4 getClient,
5 serverLogin,
6 Server,
7 Client,
8 User
9} from '../../shared/extra-utils'
10 3
11program 4program
12 .option('-u, --url <url>', 'Server url') 5 .option('-u, --url <url>', 'Server url')
@@ -22,6 +15,7 @@ if (
22 if (!program['url']) console.error('--url field is required.') 15 if (!program['url']) console.error('--url field is required.')
23 if (!program['username']) console.error('--username field is required.') 16 if (!program['username']) console.error('--username field is required.')
24 if (!program['password']) console.error('--password field is required.') 17 if (!program['password']) console.error('--password field is required.')
18
25 process.exit(-1) 19 process.exit(-1)
26} 20}
27 21
@@ -32,11 +26,11 @@ getClient(program.url)
32 user: { 26 user: {
33 username: program['username'], 27 username: program['username'],
34 password: program['password'] 28 password: program['password']
35 } as User, 29 },
36 client: { 30 client: {
37 id: res.body.client_id as string, 31 id: res.body.client_id,
38 secret: res.body.client_secret as string 32 secret: res.body.client_secret
39 } as Client 33 }
40 } as Server 34 } as Server
41 35
42 return serverLogin(server) 36 return serverLogin(server)