diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-13 11:44:16 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:18 +0200 |
commit | d0a0fa429d4651710ed951a3c11af0219e408964 (patch) | |
tree | c0638f2604e3442d1f15715b9b0f01ecab17ab20 /server/tools/peertube-auth.ts | |
parent | 41d1d075011174e73dccb74006181a92a618d7b4 (diff) | |
download | PeerTube-d0a0fa429d4651710ed951a3c11af0219e408964.tar.gz PeerTube-d0a0fa429d4651710ed951a3c11af0219e408964.tar.zst PeerTube-d0a0fa429d4651710ed951a3c11af0219e408964.zip |
Adapt CLI to new commands
Diffstat (limited to 'server/tools/peertube-auth.ts')
-rw-r--r-- | server/tools/peertube-auth.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/tools/peertube-auth.ts b/server/tools/peertube-auth.ts index 1934e7986..b9f4ef4f8 100644 --- a/server/tools/peertube-auth.ts +++ b/server/tools/peertube-auth.ts | |||
@@ -5,9 +5,8 @@ registerTSPaths() | |||
5 | 5 | ||
6 | import { OptionValues, program } from 'commander' | 6 | import { OptionValues, program } from 'commander' |
7 | import * as prompt from 'prompt' | 7 | import * as prompt from 'prompt' |
8 | import { getNetrc, getSettings, writeSettings } from './cli' | 8 | import { assignToken, buildServer, getNetrc, getSettings, writeSettings } from './cli' |
9 | import { isUserUsernameValid } from '../helpers/custom-validators/users' | 9 | import { isUserUsernameValid } from '../helpers/custom-validators/users' |
10 | import { getAccessToken } from '../../shared/extra-utils' | ||
11 | import * as CliTable3 from 'cli-table3' | 10 | import * as CliTable3 from 'cli-table3' |
12 | 11 | ||
13 | async function delInstance (url: string) { | 12 | async function delInstance (url: string) { |
@@ -97,7 +96,8 @@ program | |||
97 | // @see https://github.com/Chocobozzz/PeerTube/issues/3520 | 96 | // @see https://github.com/Chocobozzz/PeerTube/issues/3520 |
98 | result.url = stripExtraneousFromPeerTubeUrl(result.url) | 97 | result.url = stripExtraneousFromPeerTubeUrl(result.url) |
99 | 98 | ||
100 | await getAccessToken(result.url, result.username, result.password) | 99 | const server = buildServer(result.url) |
100 | await assignToken(server, result.username, result.password) | ||
101 | } catch (err) { | 101 | } catch (err) { |
102 | console.error(err.message) | 102 | console.error(err.message) |
103 | process.exit(-1) | 103 | process.exit(-1) |