aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/users/login-command.ts
diff options
context:
space:
mode:
Diffstat (limited to 'shared/extra-utils/users/login-command.ts')
-rw-r--r--shared/extra-utils/users/login-command.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/shared/extra-utils/users/login-command.ts b/shared/extra-utils/users/login-command.ts
index 8af3531f9..b4e3bb602 100644
--- a/shared/extra-utils/users/login-command.ts
+++ b/shared/extra-utils/users/login-command.ts
@@ -7,7 +7,7 @@ export class LoginCommand extends AbstractCommand {
7 7
8 login (options: OverrideCommandOptions & { 8 login (options: OverrideCommandOptions & {
9 client?: { id?: string, secret?: string } 9 client?: { id?: string, secret?: string }
10 user?: { username: string, password: string } 10 user?: { username: string, password?: string }
11 } = {}) { 11 } = {}) {
12 const { client = this.server.client, user = this.server.user } = options 12 const { client = this.server.client, user = this.server.user } = options
13 const path = '/api/v1/users/token' 13 const path = '/api/v1/users/token'
@@ -16,7 +16,7 @@ export class LoginCommand extends AbstractCommand {
16 client_id: client.id, 16 client_id: client.id,
17 client_secret: client.secret, 17 client_secret: client.secret,
18 username: user.username, 18 username: user.username,
19 password: user.password, 19 password: user.password ?? 'password',
20 response_type: 'code', 20 response_type: 'code',
21 grant_type: 'password', 21 grant_type: 'password',
22 scope: 'upload' 22 scope: 'upload'
@@ -33,10 +33,10 @@ export class LoginCommand extends AbstractCommand {
33 })) 33 }))
34 } 34 }
35 35
36 getAccessToken (arg1?: { username: string, password: string }): Promise<string> 36 getAccessToken (arg1?: { username: string, password?: string }): Promise<string>
37 getAccessToken (arg1: string, password: string): Promise<string> 37 getAccessToken (arg1: string, password?: string): Promise<string>
38 async getAccessToken (arg1?: { username: string, password: string } | string, password?: string) { 38 async getAccessToken (arg1?: { username: string, password?: string } | string, password?: string) {
39 let user: { username: string, password: string } 39 let user: { username: string, password?: string }
40 40
41 if (!arg1) user = this.server.user 41 if (!arg1) user = this.server.user
42 else if (typeof arg1 === 'object') user = arg1 42 else if (typeof arg1 === 'object') user = arg1