aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/users/login-command.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-16 09:04:35 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commit89d241a79c262b9775c233b73cff080043ebb5e6 (patch)
treecb3b6cb431d25d891ef4e02f66c61d252d17048f /shared/extra-utils/users/login-command.ts
parentd23dd9fbfc4d26026352c10f81d2795ceaf2908a (diff)
downloadPeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.tar.gz
PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.tar.zst
PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.zip
Shorter server command names
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 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'