mirror of https://github.com/Chocobozzz/PeerTube
Don't check current password param
We may have a current password that does not satisfy new password constraintspull/6527/head
parent
5f153b9d85
commit
d0304f6712
|
@ -1,7 +1,7 @@
|
||||||
import express from 'express'
|
|
||||||
import { body, param, query } from 'express-validator'
|
|
||||||
import { forceNumber } from '@peertube/peertube-core-utils'
|
import { forceNumber } from '@peertube/peertube-core-utils'
|
||||||
import { HttpStatusCode, UserRight, UserRole } from '@peertube/peertube-models'
|
import { HttpStatusCode, UserRight, UserRole } from '@peertube/peertube-models'
|
||||||
|
import express from 'express'
|
||||||
|
import { body, param, query } from 'express-validator'
|
||||||
import { exists, isBooleanValid, isIdValid, toBooleanOrNull, toIntOrNull } from '../../../helpers/custom-validators/misc.js'
|
import { exists, isBooleanValid, isIdValid, toBooleanOrNull, toIntOrNull } from '../../../helpers/custom-validators/misc.js'
|
||||||
import { isThemeNameValid } from '../../../helpers/custom-validators/plugins.js'
|
import { isThemeNameValid } from '../../../helpers/custom-validators/plugins.js'
|
||||||
import {
|
import {
|
||||||
|
@ -31,10 +31,10 @@ import { Redis } from '../../../lib/redis.js'
|
||||||
import { ActorModel } from '../../../models/actor/actor.js'
|
import { ActorModel } from '../../../models/actor/actor.js'
|
||||||
import {
|
import {
|
||||||
areValidationErrors,
|
areValidationErrors,
|
||||||
|
checkUserCanManageAccount,
|
||||||
checkUserEmailExist,
|
checkUserEmailExist,
|
||||||
checkUserIdExist,
|
checkUserIdExist,
|
||||||
checkUserNameOrEmailDoNotAlreadyExist,
|
checkUserNameOrEmailDoNotAlreadyExist,
|
||||||
checkUserCanManageAccount,
|
|
||||||
doesVideoChannelIdExist,
|
doesVideoChannelIdExist,
|
||||||
doesVideoExist,
|
doesVideoExist,
|
||||||
isValidVideoIdParam
|
isValidVideoIdParam
|
||||||
|
@ -211,7 +211,7 @@ const usersUpdateMeValidator = [
|
||||||
.custom(isUserDescriptionValid),
|
.custom(isUserDescriptionValid),
|
||||||
body('currentPassword')
|
body('currentPassword')
|
||||||
.optional()
|
.optional()
|
||||||
.custom(isUserPasswordValid),
|
.custom(exists),
|
||||||
body('password')
|
body('password')
|
||||||
.optional()
|
.optional()
|
||||||
.custom(isUserPasswordValid),
|
.custom(isUserPasswordValid),
|
||||||
|
@ -457,21 +457,7 @@ const ensureCanModerateUser = [
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
export {
|
export {
|
||||||
usersListValidator,
|
deleteMeValidator, ensureAuthUserOwnsAccountValidator, ensureCanManageChannelOrAccount, ensureCanModerateUser, userAutocompleteValidator, usersAddValidator, usersAskResetPasswordValidator, usersBlockingValidator, usersCheckCurrentPasswordFactory,
|
||||||
usersAddValidator,
|
usersGetValidator, usersListValidator, usersRemoveValidator, usersResetPasswordValidator, usersUpdateMeValidator, usersUpdateValidator, usersVideoRatingValidator, usersVideosValidator
|
||||||
deleteMeValidator,
|
|
||||||
usersBlockingValidator,
|
|
||||||
usersRemoveValidator,
|
|
||||||
usersUpdateValidator,
|
|
||||||
usersUpdateMeValidator,
|
|
||||||
usersVideoRatingValidator,
|
|
||||||
usersCheckCurrentPasswordFactory,
|
|
||||||
usersGetValidator,
|
|
||||||
usersVideosValidator,
|
|
||||||
usersAskResetPasswordValidator,
|
|
||||||
usersResetPasswordValidator,
|
|
||||||
userAutocompleteValidator,
|
|
||||||
ensureAuthUserOwnsAccountValidator,
|
|
||||||
ensureCanModerateUser,
|
|
||||||
ensureCanManageChannelOrAccount
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue