diff options
Diffstat (limited to 'shared/extra-utils/users/login-command.ts')
-rw-r--r-- | shared/extra-utils/users/login-command.ts | 12 |
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 b4e3bb602..10c3db851 100644 --- a/shared/extra-utils/users/login-command.ts +++ b/shared/extra-utils/users/login-command.ts | |||
@@ -9,7 +9,7 @@ export class LoginCommand extends AbstractCommand { | |||
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.store.client, user = this.server.store.user } = options |
13 | const path = '/api/v1/users/token' | 13 | const path = '/api/v1/users/token' |
14 | 14 | ||
15 | const body = { | 15 | const body = { |
@@ -38,7 +38,7 @@ export class LoginCommand extends AbstractCommand { | |||
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.store.user |
42 | else if (typeof arg1 === 'object') user = arg1 | 42 | else if (typeof arg1 === 'object') user = arg1 |
43 | else user = { username: arg1, password } | 43 | else user = { username: arg1, password } |
44 | 44 | ||
@@ -59,8 +59,8 @@ export class LoginCommand extends AbstractCommand { | |||
59 | const path = '/api/v1/users/token' | 59 | const path = '/api/v1/users/token' |
60 | 60 | ||
61 | const body = { | 61 | const body = { |
62 | client_id: this.server.client.id, | 62 | client_id: this.server.store.client.id, |
63 | client_secret: this.server.client.secret, | 63 | client_secret: this.server.store.client.secret, |
64 | username: username, | 64 | username: username, |
65 | response_type: 'code', | 65 | response_type: 'code', |
66 | grant_type: 'password', | 66 | grant_type: 'password', |
@@ -100,8 +100,8 @@ export class LoginCommand extends AbstractCommand { | |||
100 | const path = '/api/v1/users/token' | 100 | const path = '/api/v1/users/token' |
101 | 101 | ||
102 | const body = { | 102 | const body = { |
103 | client_id: this.server.client.id, | 103 | client_id: this.server.store.client.id, |
104 | client_secret: this.server.client.secret, | 104 | client_secret: this.server.store.client.secret, |
105 | refresh_token: options.refreshToken, | 105 | refresh_token: options.refreshToken, |
106 | response_type: 'code', | 106 | response_type: 'code', |
107 | grant_type: 'refresh_token' | 107 | grant_type: 'refresh_token' |