From 8dbf3c22b6bcf8a0deaca97b3a4220a7786fba46 Mon Sep 17 00:00:00 2001 From: Ron Rise Date: Thu, 29 Jan 2026 19:41:07 -0500 Subject: [PATCH] password reset --- src/Cli/Commands/Command.php | 2 -- src/Cli/Commands/User/ResetPassword.php | 9 +-------- src/CommandBus/Handlers/SendPasswordResetHandler.php | 2 +- src/Mailer/Templates/_base.twig | 2 +- src/Services/Facades/Redis.php | 2 ++ 5 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/Cli/Commands/Command.php b/src/Cli/Commands/Command.php index 6921ead..c4b9e61 100644 --- a/src/Cli/Commands/Command.php +++ b/src/Cli/Commands/Command.php @@ -11,8 +11,6 @@ use Siteworxpro\App\OAuth\Entities\Client; use Symfony\Component\Console\Helper\HelperSet; use Symfony\Component\Console\Helper\QuestionHelper; use Symfony\Component\Console\Input\ArgvInput; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Question\Question as QuestionInput; abstract class Command extends \Symfony\Component\Console\Command\Command implements CommandInterface diff --git a/src/Cli/Commands/User/ResetPassword.php b/src/Cli/Commands/User/ResetPassword.php index e2b9254..7385388 100644 --- a/src/Cli/Commands/User/ResetPassword.php +++ b/src/Cli/Commands/User/ResetPassword.php @@ -10,7 +10,6 @@ use Siteworxpro\App\CommandBus\Commands\SendPasswordReset; use Siteworxpro\App\Services\Facades\CommandBus; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Helper\QuestionHelper; -use Symfony\Component\Console\Input\ArgvInput; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Question\Question as QuestionInput; @@ -26,13 +25,7 @@ class ResetPassword extends Command description: 'Send password reset email to the user' ); } - - /** - * @param ArgvInput|ClimateOutput $input - * @param ClimateOutput $output - * @return int - */ - public function __invoke(ClimateOutput|ArgvInput $input, ClimateOutput $output): int + public function __invoke($input, $output): int { $client = $this->askForClient($output, $input); diff --git a/src/CommandBus/Handlers/SendPasswordResetHandler.php b/src/CommandBus/Handlers/SendPasswordResetHandler.php index 9732417..37c360b 100644 --- a/src/CommandBus/Handlers/SendPasswordResetHandler.php +++ b/src/CommandBus/Handlers/SendPasswordResetHandler.php @@ -48,7 +48,7 @@ class SendPasswordResetHandler extends CommandHandler throw new CommandHandlerException('Failed to send password reset email.'); } - Redis::set('password_reset:' . $command->getUser()->id, $token, 3600); + Redis::set('password_reset:' . $command->getUser()->id, $token, 'EX', Redis::MINUTE * 15); return $command->getUser(); } diff --git a/src/Mailer/Templates/_base.twig b/src/Mailer/Templates/_base.twig index 9414e7a..f6ac718 100644 --- a/src/Mailer/Templates/_base.twig +++ b/src/Mailer/Templates/_base.twig @@ -19,6 +19,6 @@ - {{ content|raw }} + {% block body %}{% endblock %} \ No newline at end of file diff --git a/src/Services/Facades/Redis.php b/src/Services/Facades/Redis.php index 0a39d1a..c2493d1 100644 --- a/src/Services/Facades/Redis.php +++ b/src/Services/Facades/Redis.php @@ -23,6 +23,8 @@ use Siteworxpro\App\Services\Facade; */ class Redis extends Facade { + public const MINUTE = 60; + /** * Get the registered name of the component. *