Skip to content

Commit

Permalink
BC-8054 - fix log of email from user (#5256)
Browse files Browse the repository at this point in the history
* BC-8054 - fix log of email from user

* fixup! BC-8054 - fix log of email from user
  • Loading branch information
SevenWaysDP authored Sep 25, 2024
1 parent 5d0f6d5 commit 7425d58
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,17 +211,17 @@ export class AccountService extends AbstractAccountService implements DeletionSe
const firstLoginPassed = userPreferences ? userPreferences.firstLogin : false;

if (!user.forcePasswordChange && firstLoginPassed) {
throw new ForbiddenOperationError('The password is not temporary, hence can not be changed.');
throw new ForbiddenOperationError('The password is not temporary, hence can not be changed.', { userId });
} // Password change was forces or this is a first logon for the user

const account: Account = await this.findByUserIdOrFail(userId);

if (account.systemId) {
throw new ForbiddenOperationError('External account details can not be changed.');
throw new ForbiddenOperationError('External account details can not be changed.', { userId });
}

if (await this.validatePassword(account, password)) {
throw new ForbiddenOperationError('New password can not be same as old password.');
throw new ForbiddenOperationError('New password can not be same as old password.', { userId });
}

try {
Expand Down
1 change: 1 addition & 0 deletions src/middleware/errorHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ const secretDataKeys = (() =>
'_csrf',
'searchUserPassword',
'authorization',
'student-email',
].map((k) => k.toLocaleLowerCase()))();

const filterSecretValue = (key, value) => {
Expand Down

0 comments on commit 7425d58

Please sign in to comment.