diff options
Diffstat (limited to 'server/tools/peertube-get-access-token.ts')
-rw-r--r-- | server/tools/peertube-get-access-token.ts | 10 |
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' | |||
2 | registerTSPaths() | 2 | registerTSPaths() |
3 | 3 | ||
4 | import { program } from 'commander' | 4 | import { program } from 'commander' |
5 | import { getAccessToken } from '../../shared/extra-utils' | 5 | import { assignToken, buildServer } from './cli' |
6 | 6 | ||
7 | program | 7 | program |
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 | ||
27 | getAccessToken(options.url, options.username, options.password) | 27 | const server = buildServer(options.url) |
28 | .then(accessToken => { | 28 | |
29 | console.log(accessToken) | 29 | assignToken(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 => { |