diff options
Diffstat (limited to 'shared/extra-utils/users/users-command.ts')
-rw-r--r-- | shared/extra-utils/users/users-command.ts | 8 |
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 | } |