aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tools/peertube-get-access-token.ts
diff options
context:
space:
mode:
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 => {