aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tools/peertube-auth.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-07-11 17:23:24 +0200
committerChocobozzz <chocobozzz@cpy.re>2019-07-24 10:58:16 +0200
commit8d2be0ed7bb87283a1ec98609df6b82d83db706a (patch)
tree31a36b252df32be83ceb77658a53b57f9d15e8ac /server/tools/peertube-auth.ts
parentdba85a1e9e9f603ba52e1ea42deaf3fdd799b1d8 (diff)
downloadPeerTube-8d2be0ed7bb87283a1ec98609df6b82d83db706a.tar.gz
PeerTube-8d2be0ed7bb87283a1ec98609df6b82d83db706a.tar.zst
PeerTube-8d2be0ed7bb87283a1ec98609df6b82d83db706a.zip
WIP plugins: move plugin CLI in peertube script
Install/uninstall/list plugins remotely
Diffstat (limited to 'server/tools/peertube-auth.ts')
-rw-r--r--server/tools/peertube-auth.ts12
1 files changed, 10 insertions, 2 deletions
diff --git a/server/tools/peertube-auth.ts b/server/tools/peertube-auth.ts
index 1035d664a..d4ad56e47 100644
--- a/server/tools/peertube-auth.ts
+++ b/server/tools/peertube-auth.ts
@@ -1,8 +1,8 @@
1import * as program from 'commander' 1import * as program from 'commander'
2import * as prompt from 'prompt' 2import * as prompt from 'prompt'
3import { getSettings, writeSettings, getNetrc } from './cli' 3import { getNetrc, getSettings, writeSettings } from './cli'
4import { isHostValid } from '../helpers/custom-validators/servers'
5import { isUserUsernameValid } from '../helpers/custom-validators/users' 4import { isUserUsernameValid } from '../helpers/custom-validators/users'
5import { getAccessToken, login } from '../../shared/extra-utils'
6 6
7const Table = require('cli-table') 7const Table = require('cli-table')
8 8
@@ -76,6 +76,14 @@ program
76 } 76 }
77 } 77 }
78 }, async (_, result) => { 78 }, async (_, result) => {
79 // Check credentials
80 try {
81 await getAccessToken(result.url, result.username, result.password)
82 } catch (err) {
83 console.error(err.message)
84 process.exit(-1)
85 }
86
79 await setInstance(result.url, result.username, result.password, program['default']) 87 await setInstance(result.url, result.username, result.password, program['default'])
80 88
81 process.exit(0) 89 process.exit(0)