X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=shared%2Fserver-commands%2Fusers%2Fusers-command.ts;h=8a42fafc817a65503e59ac5f5acad2e68cc0c6d7;hb=8ca52bcc2c37d457e8b19a237c66b8dd1c00b6b9;hp=b5ae9008e4ce63b631aa797e0e0a99e2d9b837f4;hpb=c3edc5b074aa4bb1861ed0a94d3713808e87170f;p=github%2FChocobozzz%2FPeerTube.git diff --git a/shared/server-commands/users/users-command.ts b/shared/server-commands/users/users-command.ts index b5ae9008e..8a42fafc8 100644 --- a/shared/server-commands/users/users-command.ts +++ b/shared/server-commands/users/users-command.ts @@ -1,5 +1,4 @@ -import { omit } from 'lodash' -import { pick } from '@shared/core-utils' +import { omit, pick } from '@shared/core-utils' import { HttpStatusCode, MyUser, @@ -203,7 +202,8 @@ export class UsersCommand extends AbstractCommand { token, userId: user.id, userChannelId: me.videoChannels[0].id, - userChannelName: me.videoChannels[0].name + userChannelName: me.videoChannels[0].name, + password } } @@ -214,34 +214,6 @@ export class UsersCommand extends AbstractCommand { return this.server.login.getAccessToken({ username, password }) } - register (options: OverrideCommandOptions & { - username: string - password?: string - displayName?: string - channel?: { - name: string - displayName: string - } - }) { - const { username, password = 'password', displayName, channel } = options - const path = '/api/v1/users/register' - - return this.postBodyRequest({ - ...options, - - path, - fields: { - username, - password, - email: username + '@example.com', - displayName, - channel - }, - implicitToken: false, - defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 - }) - } - // --------------------------------------------------------------------------- getMyInfo (options: OverrideCommandOptions = {}) { @@ -298,7 +270,7 @@ export class UsersCommand extends AbstractCommand { updateMe (options: OverrideCommandOptions & UserUpdateMe) { const path = '/api/v1/users/me' - const toSend: UserUpdateMe = omit(options, 'url', 'accessToken') + const toSend: UserUpdateMe = omit(options, [ 'expectedStatus', 'token' ]) return this.putBodyRequest({ ...options,