diff options
Diffstat (limited to 'server/controllers')
-rw-r--r-- | server/controllers/api/users/index.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/server/controllers/api/users/index.ts b/server/controllers/api/users/index.ts index 0aafba66e..a04f77841 100644 --- a/server/controllers/api/users/index.ts +++ b/server/controllers/api/users/index.ts | |||
@@ -46,6 +46,7 @@ import { mySubscriptionsRouter } from './my-subscriptions' | |||
46 | import { CONFIG } from '../../../initializers/config' | 46 | import { CONFIG } from '../../../initializers/config' |
47 | import { sequelizeTypescript } from '../../../initializers/database' | 47 | import { sequelizeTypescript } from '../../../initializers/database' |
48 | import { UserAdminFlag } from '../../../../shared/models/users/user-flag.model' | 48 | import { UserAdminFlag } from '../../../../shared/models/users/user-flag.model' |
49 | import { UserRegister } from '../../../../shared/models/users/user-register.model' | ||
49 | 50 | ||
50 | const auditLogger = auditLoggerFactory('users') | 51 | const auditLogger = auditLoggerFactory('users') |
51 | 52 | ||
@@ -197,7 +198,7 @@ async function createUser (req: express.Request, res: express.Response) { | |||
197 | } | 198 | } |
198 | 199 | ||
199 | async function registerUser (req: express.Request, res: express.Response) { | 200 | async function registerUser (req: express.Request, res: express.Response) { |
200 | const body: UserCreate = req.body | 201 | const body: UserRegister = req.body |
201 | 202 | ||
202 | const userToCreate = new UserModel({ | 203 | const userToCreate = new UserModel({ |
203 | username: body.username, | 204 | username: body.username, |
@@ -211,7 +212,7 @@ async function registerUser (req: express.Request, res: express.Response) { | |||
211 | emailVerified: CONFIG.SIGNUP.REQUIRES_EMAIL_VERIFICATION ? false : null | 212 | emailVerified: CONFIG.SIGNUP.REQUIRES_EMAIL_VERIFICATION ? false : null |
212 | }) | 213 | }) |
213 | 214 | ||
214 | const { user } = await createUserAccountAndChannelAndPlaylist(userToCreate) | 215 | const { user } = await createUserAccountAndChannelAndPlaylist(userToCreate, body.channel) |
215 | 216 | ||
216 | auditLogger.create(body.username, new UserAuditView(user.toFormattedJSON())) | 217 | auditLogger.create(body.username, new UserAuditView(user.toFormattedJSON())) |
217 | logger.info('User %s with its channel and account registered.', body.username) | 218 | logger.info('User %s with its channel and account registered.', body.username) |