aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tools/peertube-auth.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-07-04 15:03:15 +0200
committerChocobozzz <me@florianbigard.com>2019-07-04 15:03:15 +0200
commitfd0bfc3ac43eb0c0c2ac0b21bc2e0670f546384f (patch)
treee7f20a348fbe9283563e90492fc9e5bce7926ea7 /server/tools/peertube-auth.ts
parentcb9d028a6ba2edc33fc658d3a6a7d3661e9fb5f0 (diff)
downloadPeerTube-fd0bfc3ac43eb0c0c2ac0b21bc2e0670f546384f.tar.gz
PeerTube-fd0bfc3ac43eb0c0c2ac0b21bc2e0670f546384f.tar.zst
PeerTube-fd0bfc3ac43eb0c0c2ac0b21bc2e0670f546384f.zip
peertube auth add wants a URL (and not a host)
Diffstat (limited to 'server/tools/peertube-auth.ts')
-rw-r--r--server/tools/peertube-auth.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/server/tools/peertube-auth.ts b/server/tools/peertube-auth.ts
index ff5ffb60e..1035d664a 100644
--- a/server/tools/peertube-auth.ts
+++ b/server/tools/peertube-auth.ts
@@ -39,7 +39,7 @@ async function setInstance (url: string, username: string, password: string, isD
39} 39}
40 40
41function isURLaPeerTubeInstance (url: string) { 41function isURLaPeerTubeInstance (url: string) {
42 return isHostValid(url) || (url.includes('localhost')) 42 return url.startsWith('http://') || url.startsWith('https://')
43} 43}
44 44
45program 45program
@@ -61,6 +61,7 @@ program
61 url: { 61 url: {
62 description: 'instance url', 62 description: 'instance url',
63 conform: (value) => isURLaPeerTubeInstance(value), 63 conform: (value) => isURLaPeerTubeInstance(value),
64 message: 'It should be an URL (https://peertube.example.com)',
64 required: true 65 required: true
65 }, 66 },
66 username: { 67 username: {