From d0a0fa429d4651710ed951a3c11af0219e408964 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 13 Jul 2021 11:44:16 +0200 Subject: Adapt CLI to new commands --- shared/extra-utils/users/login-command.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'shared/extra-utils/users') diff --git a/shared/extra-utils/users/login-command.ts b/shared/extra-utils/users/login-command.ts index 97efcb766..8af3531f9 100644 --- a/shared/extra-utils/users/login-command.ts +++ b/shared/extra-utils/users/login-command.ts @@ -1,4 +1,3 @@ -import { PeerTubeRequestError } from '@server/helpers/requests' import { HttpStatusCode } from '@shared/core-utils' import { PeerTubeProblemDocument } from '@shared/models' import { unwrapBody } from '../requests' @@ -34,8 +33,8 @@ export class LoginCommand extends AbstractCommand { })) } - getAccessToken (user?: { username: string, password: string }): Promise - getAccessToken (username: string, password: string): Promise + getAccessToken (arg1?: { username: string, password: string }): Promise + getAccessToken (arg1: string, password: string): Promise async getAccessToken (arg1?: { username: string, password: string } | string, password?: string) { let user: { username: string, password: string } @@ -48,7 +47,7 @@ export class LoginCommand extends AbstractCommand { return body.access_token } catch (err) { - throw new Error('Cannot authenticate. Please check your username/password.') + throw new Error(`Cannot authenticate. Please check your username/password. (${err})`) } } -- cgit v1.2.3