diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-13 11:44:16 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:18 +0200 |
commit | d0a0fa429d4651710ed951a3c11af0219e408964 (patch) | |
tree | c0638f2604e3442d1f15715b9b0f01ecab17ab20 /shared/extra-utils/users/login-command.ts | |
parent | 41d1d075011174e73dccb74006181a92a618d7b4 (diff) | |
download | PeerTube-d0a0fa429d4651710ed951a3c11af0219e408964.tar.gz PeerTube-d0a0fa429d4651710ed951a3c11af0219e408964.tar.zst PeerTube-d0a0fa429d4651710ed951a3c11af0219e408964.zip |
Adapt CLI to new commands
Diffstat (limited to 'shared/extra-utils/users/login-command.ts')
-rw-r--r-- | shared/extra-utils/users/login-command.ts | 7 |
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 @@ | |||
1 | import { PeerTubeRequestError } from '@server/helpers/requests' | ||
2 | import { HttpStatusCode } from '@shared/core-utils' | 1 | import { HttpStatusCode } from '@shared/core-utils' |
3 | import { PeerTubeProblemDocument } from '@shared/models' | 2 | import { PeerTubeProblemDocument } from '@shared/models' |
4 | import { unwrapBody } from '../requests' | 3 | import { 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 | ||