mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 19:42:24 +02:00
Add email to users
This commit is contained in:
parent
5d67f289df
commit
ad4a8a1cca
19 changed files with 164 additions and 12 deletions
|
@ -13,11 +13,12 @@ const validatorsUsers = {
|
|||
function usersAdd (req, res, next) {
|
||||
req.checkBody('username', 'Should have a valid username').isUserUsernameValid()
|
||||
req.checkBody('password', 'Should have a valid password').isUserPasswordValid()
|
||||
req.checkBody('email', 'Should have a valid email').isEmail()
|
||||
|
||||
logger.debug('Checking usersAdd parameters', { parameters: req.body })
|
||||
|
||||
checkErrors(req, res, function () {
|
||||
db.User.loadByUsername(req.body.username, function (err, user) {
|
||||
db.User.loadByUsernameOrEmail(req.body.username, req.body.email, function (err, user) {
|
||||
if (err) {
|
||||
logger.error('Error in usersAdd request validator.', { error: err })
|
||||
return res.sendStatus(500)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue