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

Add a logger in the ResettingController #7257

Merged
merged 2 commits into from
Mar 18, 2024

Conversation

mamazu
Copy link
Contributor

@mamazu mamazu commented Jan 28, 2024

Q A
Bug fix? no
New feature? yes
BC breaks? yes
Deprecations? yes
Fixed tickets fixes #7243
Related issues/PRs -
License MIT
Documentation PR -

What's in this PR?

Adding the logger to the ResettingController

Why?

Swallowing the error and not showing any errors is not very helpful for debugging purposes adding a Logger to at least log the error will help.

@@ -228,7 +240,9 @@ public function sendEmailAction(Request $request)
$email = $this->getEmail($user);
$this->sendTokenEmail($user, $this->getSenderAddress($request), $email, $token);
} catch (\Exception $ex) {
// do nothing
if ($this->logger instanceof LoggerInterface) {
Copy link
Member

Choose a reason for hiding this comment

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

This check can be avoided when fallback on __construct to new NullLogger.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -62,6 +62,7 @@
<argument>%sulu_security.reset_password.mail.token_send_limit%</argument>
<argument>%sulu_admin.email%</argument>
<argument>%kernel.secret%%</argument>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Btw that looks like a typo is it supposed to have two percent signs?

Copy link
Member

Choose a reason for hiding this comment

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

Looks wrong to me. Think this should be only one %. Currently it may just added always a % to the secret.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've opened an issue for that. I wouldn't want to fix that here.

@alexander-schranz alexander-schranz changed the base branch from 2.4 to 2.6 March 18, 2024 08:59
@alexander-schranz alexander-schranz changed the title Adding a logger in the ResettingController Add a logger in the ResettingController Mar 18, 2024
@alexander-schranz alexander-schranz added the Feature New functionality not yet included in Sulu label Mar 18, 2024
@alexander-schranz alexander-schranz enabled auto-merge (squash) March 18, 2024 09:17
@alexander-schranz alexander-schranz merged commit 40ca8e0 into sulu:2.6 Mar 18, 2024
8 checks passed
@mamazu mamazu deleted the logging_errors_with_reset_token branch March 18, 2024 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New functionality not yet included in Sulu
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants