aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tools/peertube-get-access-token.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-13 11:44:16 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commitd0a0fa429d4651710ed951a3c11af0219e408964 (patch)
treec0638f2604e3442d1f15715b9b0f01ecab17ab20 /server/tools/peertube-get-access-token.ts
parent41d1d075011174e73dccb74006181a92a618d7b4 (diff)
downloadPeerTube-d0a0fa429d4651710ed951a3c11af0219e408964.tar.gz
PeerTube-d0a0fa429d4651710ed951a3c11af0219e408964.tar.zst
PeerTube-d0a0fa429d4651710ed951a3c11af0219e408964.zip
Adapt CLI to new commands
Diffstat (limited to 'server/tools/peertube-get-access-token.ts')
-rw-r--r--server/tools/peertube-get-access-token.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/server/tools/peertube-get-access-token.ts b/server/tools/peertube-get-access-token.ts
index 5868d0548..a67de9180 100644
--- a/server/tools/peertube-get-access-token.ts
+++ b/server/tools/peertube-get-access-token.ts
@@ -2,7 +2,7 @@ import { registerTSPaths } from '../helpers/register-ts-paths'
2registerTSPaths() 2registerTSPaths()
3 3
4import { program } from 'commander' 4import { program } from 'commander'
5import { getAccessToken } from '../../shared/extra-utils' 5import { assignToken, buildServer } from './cli'
6 6
7program 7program
8 .option('-u, --url <url>', 'Server url') 8 .option('-u, --url <url>', 'Server url')
@@ -24,9 +24,11 @@ if (
24 process.exit(-1) 24 process.exit(-1)
25} 25}
26 26
27getAccessToken(options.url, options.username, options.password) 27const server = buildServer(options.url)
28 .then(accessToken => { 28
29 console.log(accessToken) 29assignToken(server, options.username, options.password)
30 .then(() => {
31 console.log(server.accessToken)
30 process.exit(0) 32 process.exit(0)
31 }) 33 })
32 .catch(err => { 34 .catch(err => {