aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-13 11:44:16 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commitd0a0fa429d4651710ed951a3c11af0219e408964 (patch)
treec0638f2604e3442d1f15715b9b0f01ecab17ab20 /shared
parent41d1d075011174e73dccb74006181a92a618d7b4 (diff)
downloadPeerTube-d0a0fa429d4651710ed951a3c11af0219e408964.tar.gz
PeerTube-d0a0fa429d4651710ed951a3c11af0219e408964.tar.zst
PeerTube-d0a0fa429d4651710ed951a3c11af0219e408964.zip
Adapt CLI to new commands
Diffstat (limited to 'shared')
-rw-r--r--shared/extra-utils/users/login-command.ts7
1 files changed, 3 insertions, 4 deletions
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 @@
1import { PeerTubeRequestError } from '@server/helpers/requests'
2import { HttpStatusCode } from '@shared/core-utils' 1import { HttpStatusCode } from '@shared/core-utils'
3import { PeerTubeProblemDocument } from '@shared/models' 2import { PeerTubeProblemDocument } from '@shared/models'
4import { unwrapBody } from '../requests' 3import { unwrapBody } from '../requests'
@@ -34,8 +33,8 @@ export class LoginCommand extends AbstractCommand {
34 })) 33 }))
35 } 34 }
36 35
37 getAccessToken (user?: { username: string, password: string }): Promise<string> 36 getAccessToken (arg1?: { username: string, password: string }): Promise<string>
38 getAccessToken (username: string, password: string): Promise<string> 37 getAccessToken (arg1: string, password: string): Promise<string>
39 async getAccessToken (arg1?: { username: string, password: string } | string, password?: string) { 38 async getAccessToken (arg1?: { username: string, password: string } | string, password?: string) {
40 let user: { username: string, password: string } 39 let user: { username: string, password: string }
41 40
@@ -48,7 +47,7 @@ export class LoginCommand extends AbstractCommand {
48 47
49 return body.access_token 48 return body.access_token
50 } catch (err) { 49 } catch (err) {
51 throw new Error('Cannot authenticate. Please check your username/password.') 50 throw new Error(`Cannot authenticate. Please check your username/password. (${err})`)
52 } 51 }
53 } 52 }
54 53