Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BC-8054 - fix log of email from user #5256

Merged
merged 2 commits into from
Sep 25, 2024
Merged
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
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',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ich bin mir nicht sicher ob wir dadurch irgendwo in den Logs die einzige Zuordnung verlieren.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Das wir nur beim FirstLogin verwendet. Aber das sind auch Kunden Daten die habe so oder so nicht im logs zu suchen.

].map((k) => k.toLocaleLowerCase()))();

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