You've already forked php-auth
generated from siteworxpro/Php-Template
password reset
All checks were successful
🧪✨ Tests Workflow / 🛡️ 🔒 Library Audit (push) Successful in 1s
🧪✨ Tests Workflow / 📝 ✨ Code Lint (push) Successful in 1s
🧪✨ Tests Workflow / 🛡️ 🔒 License Check (push) Successful in 17s
🧪✨ Tests Workflow / 🐙 🔍 Code Sniffer (push) Successful in 22s
🧪✨ Tests Workflow / 🧪 ✨ Database Migrations (push) Successful in 52s
🧪✨ Tests Workflow / 🧪 ✅ Unit Tests (push) Successful in -2s
All checks were successful
🧪✨ Tests Workflow / 🛡️ 🔒 Library Audit (push) Successful in 1s
🧪✨ Tests Workflow / 📝 ✨ Code Lint (push) Successful in 1s
🧪✨ Tests Workflow / 🛡️ 🔒 License Check (push) Successful in 17s
🧪✨ Tests Workflow / 🐙 🔍 Code Sniffer (push) Successful in 22s
🧪✨ Tests Workflow / 🧪 ✨ Database Migrations (push) Successful in 52s
🧪✨ Tests Workflow / 🧪 ✅ Unit Tests (push) Successful in -2s
This commit is contained in:
@@ -11,8 +11,6 @@ use Siteworxpro\App\OAuth\Entities\Client;
|
|||||||
use Symfony\Component\Console\Helper\HelperSet;
|
use Symfony\Component\Console\Helper\HelperSet;
|
||||||
use Symfony\Component\Console\Helper\QuestionHelper;
|
use Symfony\Component\Console\Helper\QuestionHelper;
|
||||||
use Symfony\Component\Console\Input\ArgvInput;
|
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;
|
use Symfony\Component\Console\Question\Question as QuestionInput;
|
||||||
|
|
||||||
abstract class Command extends \Symfony\Component\Console\Command\Command implements CommandInterface
|
abstract class Command extends \Symfony\Component\Console\Command\Command implements CommandInterface
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ use Siteworxpro\App\CommandBus\Commands\SendPasswordReset;
|
|||||||
use Siteworxpro\App\Services\Facades\CommandBus;
|
use Siteworxpro\App\Services\Facades\CommandBus;
|
||||||
use Symfony\Component\Console\Attribute\AsCommand;
|
use Symfony\Component\Console\Attribute\AsCommand;
|
||||||
use Symfony\Component\Console\Helper\QuestionHelper;
|
use Symfony\Component\Console\Helper\QuestionHelper;
|
||||||
use Symfony\Component\Console\Input\ArgvInput;
|
|
||||||
use Symfony\Component\Console\Input\InputOption;
|
use Symfony\Component\Console\Input\InputOption;
|
||||||
use Symfony\Component\Console\Question\Question as QuestionInput;
|
use Symfony\Component\Console\Question\Question as QuestionInput;
|
||||||
|
|
||||||
@@ -26,13 +25,7 @@ class ResetPassword extends Command
|
|||||||
description: 'Send password reset email to the user'
|
description: 'Send password reset email to the user'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
public function __invoke($input, $output): int
|
||||||
/**
|
|
||||||
* @param ArgvInput|ClimateOutput $input
|
|
||||||
* @param ClimateOutput $output
|
|
||||||
* @return int
|
|
||||||
*/
|
|
||||||
public function __invoke(ClimateOutput|ArgvInput $input, ClimateOutput $output): int
|
|
||||||
{
|
{
|
||||||
$client = $this->askForClient($output, $input);
|
$client = $this->askForClient($output, $input);
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class SendPasswordResetHandler extends CommandHandler
|
|||||||
throw new CommandHandlerException('Failed to send password reset email.');
|
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();
|
return $command->getUser();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,6 @@
|
|||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{{ content|raw }}
|
{% block body %}{% endblock %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -23,6 +23,8 @@ use Siteworxpro\App\Services\Facade;
|
|||||||
*/
|
*/
|
||||||
class Redis extends Facade
|
class Redis extends Facade
|
||||||
{
|
{
|
||||||
|
public const MINUTE = 60;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the registered name of the component.
|
* Get the registered name of the component.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user