Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).

### Unreleased

- user: PUT accepts current_password

### [1.0.1] - 2026-08-31

- zone: run 3 disabled validation cases (#33)
Expand Down
1 change: 1 addition & 0 deletions lib/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export const PUT = Joi.object({
username: username,
email: email,
password: password,
current_password: Joi.string().min(1),
is_admin: Joi.boolean(),
deleted: Joi.boolean(),
inherit_group_permissions: Joi.boolean(),
Expand Down
8 changes: 8 additions & 0 deletions lib/user.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ describe('user', function () {
assert.ok(schema.PUT.validate({ group_write: 'sometimes' }).error)
})

it('takes the current password with a new one in PUT', () => {
const payload = { password: 'This 1 Is Very 3#$@!in', current_password: 'weak' }
const { error, value } = schema.PUT.validate(payload)
assert.ifError(error)
assert.deepEqual(value, payload)
assert.ok(schema.PUT.validate({ ...payload, current_password: '' }).error)
})

describe('v2', function () {
it('accepts valid', () => {
const testCase = JSON.parse(JSON.stringify(userV2))
Expand Down
Loading