diff options
Diffstat (limited to 'shared/extra-utils/users')
-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 | ||