X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftools%2Fpeertube-get-access-token.ts;h=103495347c7ca6025d3a23ba365ecb51749e7c08;hb=5f189c9c85449951254646ddf6cd6c84bc4c06ff;hp=a68665f5bb7ff6bcfe6888a60201869a1495fc60;hpb=88108880bbdba473cfe36ecbebc1c3c4f972e102;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tools/peertube-get-access-token.ts b/server/tools/peertube-get-access-token.ts index a68665f5b..103495347 100644 --- a/server/tools/peertube-get-access-token.ts +++ b/server/tools/peertube-get-access-token.ts @@ -1,12 +1,5 @@ import * as program from 'commander' - -import { - getClient, - serverLogin, - Server, - Client, - User -} from '../../shared/utils' +import { getClient, Server, serverLogin } from '../../shared/extra-utils' program .option('-u, --url ', 'Server url') @@ -22,6 +15,7 @@ if ( if (!program['url']) console.error('--url field is required.') if (!program['username']) console.error('--username field is required.') if (!program['password']) console.error('--password field is required.') + process.exit(-1) } @@ -32,11 +26,11 @@ getClient(program.url) user: { username: program['username'], password: program['password'] - } as User, + }, client: { - id: res.body.client_id as string, - secret: res.body.client_secret as string - } as Client + id: res.body.client_id, + secret: res.body.client_secret + } } as Server return serverLogin(server)