Skip to content
Open
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
9 changes: 4 additions & 5 deletions src/user/profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,11 +362,10 @@

if (isSelf && hasPassword) {
const correct = await User.isPasswordCorrect(data.uid, data.currentPassword, data.ip);
if (!correct) {
throw new Error('[[user:change-password-error-wrong-current]]');
}
if (data.currentPassword === data.newPassword) {
throw new Error('[[user:change-password-error-same-password]]');
if (!correct || data.currentPassword === data.newPassword) {
throw new Error(!correct
? '[[user:change-password-error-wrong-current]]'

Check failure on line 367 in src/user/profile.js

View workflow job for this annotation

GitHub Actions / test

'?' should be placed at the end of the line
: '[[user:change-password-error-same-password]]');

Check failure on line 368 in src/user/profile.js

View workflow job for this annotation

GitHub Actions / test

':' should be placed at the end of the line
}
}

Expand Down
Loading