X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftools%2Fget-access-token.ts;h=d86c84c8dcc671a4a83580c4a6ea2c53775ed411;hb=2b62cccd75e9025fb66148bcb1feea2a458ee8e4;hp=66fa7081449b5d606ea416db69110601a01c8701;hpb=a7fea183f0f69104b209e7bfdd6435be28165f22;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tools/get-access-token.ts b/server/tools/get-access-token.ts index 66fa70814..d86c84c8d 100644 --- a/server/tools/get-access-token.ts +++ b/server/tools/get-access-token.ts @@ -2,7 +2,10 @@ import * as program from 'commander' import { getClient, - serverLogin + serverLogin, + Server, + Client, + User } from '../tests/utils/index' program @@ -19,22 +22,19 @@ if ( throw new Error('All arguments are required.') } -const server = { - url: program['url'], - user: { - username: program['username'], - password: program['password'] - }, - client: { - id: null, - secret: null - } -} - getClient(program.url) .then(res => { - server.client.id = res.body.client_id - server.client.secret = res.body.client_secret + const server = { + url: 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 + } as Server return serverLogin(server) })