X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftools%2Fpeertube-auth.ts;h=afa19ee085753b8eae0db246aaef1d0d46e8b897;hb=577280e4c0267b869842b68a55c06dbf2a1b3050;hp=1934e7986ea62bff00e8432c808340b161c37748;hpb=cf21b2cbef61929177b9c09b5e017c3b7eb8535d;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tools/peertube-auth.ts b/server/tools/peertube-auth.ts index 1934e7986..afa19ee08 100644 --- a/server/tools/peertube-auth.ts +++ b/server/tools/peertube-auth.ts @@ -4,11 +4,11 @@ import { registerTSPaths } from '../helpers/register-ts-paths' registerTSPaths() import { OptionValues, program } from 'commander' -import * as prompt from 'prompt' -import { getNetrc, getSettings, writeSettings } from './cli' +import { assignToken, buildServer, getNetrc, getSettings, writeSettings } from './cli' import { isUserUsernameValid } from '../helpers/custom-validators/users' -import { getAccessToken } from '../../shared/extra-utils' -import * as CliTable3 from 'cli-table3' +import CliTable3 from 'cli-table3' + +import prompt = require('prompt') async function delInstance (url: string) { const [ settings, netrc ] = await Promise.all([ getSettings(), getNetrc() ]) @@ -97,7 +97,8 @@ program // @see https://github.com/Chocobozzz/PeerTube/issues/3520 result.url = stripExtraneousFromPeerTubeUrl(result.url) - await getAccessToken(result.url, result.username, result.password) + const server = buildServer(result.url) + await assignToken(server, result.username, result.password) } catch (err) { console.error(err.message) process.exit(-1)