aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared
diff options
context:
space:
mode:
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