aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/users
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-10-19 15:02:43 +0200
committerChocobozzz <me@florianbigard.com>2021-10-20 09:25:44 +0200
commit906f46d0849fac3e2b30b7bdd57759e189d6a35d (patch)
tree3fbe0023c046ade74995010ae21f6e2eece1ddf5 /shared/extra-utils/users
parent4beda9e12adc7b1f3b178cecd6863ebf3cf431f1 (diff)
downloadPeerTube-906f46d0849fac3e2b30b7bdd57759e189d6a35d.tar.gz
PeerTube-906f46d0849fac3e2b30b7bdd57759e189d6a35d.tar.zst
PeerTube-906f46d0849fac3e2b30b7bdd57759e189d6a35d.zip
Split check user params tests
Diffstat (limited to 'shared/extra-utils/users')
-rw-r--r--shared/extra-utils/users/users-command.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/shared/extra-utils/users/users-command.ts b/shared/extra-utils/users/users-command.ts
index ddd20d041..2a10e4fc8 100644
--- a/shared/extra-utils/users/users-command.ts
+++ b/shared/extra-utils/users/users-command.ts
@@ -191,9 +191,9 @@ export class UsersCommand extends AbstractCommand {
191 })).then(res => res.user) 191 })).then(res => res.user)
192 } 192 }
193 193
194 async generate (username: string) { 194 async generate (username: string, role?: UserRole) {
195 const password = 'password' 195 const password = 'password'
196 const user = await this.create({ username, password }) 196 const user = await this.create({ username, password, role })
197 197
198 const token = await this.server.login.getAccessToken({ username, password }) 198 const token = await this.server.login.getAccessToken({ username, password })
199 199
@@ -206,9 +206,9 @@ export class UsersCommand extends AbstractCommand {
206 } 206 }
207 } 207 }
208 208
209 async generateUserAndToken (username: string) { 209 async generateUserAndToken (username: string, role?: UserRole) {
210 const password = 'password' 210 const password = 'password'
211 await this.create({ username, password }) 211 await this.create({ username, password, role })
212 212
213 return this.server.login.getAccessToken({ username, password }) 213 return this.server.login.getAccessToken({ username, password })
214 } 214 }