Password reset and email
Some checks failed
🧪✨ Tests Workflow / 🛡️ 🔒 Library Audit (push) Failing after 1m19s
🧪✨ Tests Workflow / 📝 ✨ Code Lint (push) Successful in 1m9s
🧪✨ Tests Workflow / 🛡️ 🔒 License Check (push) Failing after 1m19s
🧪✨ Tests Workflow / 🧪 ✨ Database Migrations (push) Successful in 1m34s
🧪✨ Tests Workflow / 🐙 🔍 Code Sniffer (push) Failing after 1m20s
🧪✨ Tests Workflow / 🧪 ✅ Unit Tests (push) Failing after 12s

This commit is contained in:
2026-01-29 18:52:49 -05:00
parent b2b85b5261
commit e9cb49d942
26 changed files with 693 additions and 91 deletions

View File

@@ -4,12 +4,10 @@ declare(strict_types=1);
namespace Siteworxpro\App\Cli\Commands\User;
use Illuminate\Database\Eloquent\Collection;
use Siteworxpro\App\Cli\Commands\Command;
use Siteworxpro\App\CommandBus\Commands\CreateUser;
use Siteworxpro\App\Models\ClientUser;
use Siteworxpro\App\Models\User;
use Siteworxpro\App\OAuth\Entities\Client;
use Siteworxpro\App\Services\Facades\CommandBus;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command as SCommand;
@@ -21,23 +19,7 @@ class Add extends Command
{
public function __invoke($input, $output): int
{
/** @var Collection<Client> $clients */
$clients = Client::whereJsonContains('grant_types', 'authorization_code')
->get(['id', 'name']);
$output->info('Available OAuth Clients:');
foreach ($clients as $client) {
$output->out("[$client->id] $client->name");
}
$question = new QuestionInput('Enter the client ID to associate the new user with: ');
$question->setAutocompleterValues($clients->pluck('id')->toArray());
/** @var QuestionHelper $helper */
$helper = $this->getHelper('question');
$id = $helper->ask($input, $output, $question);
$client = Client::find($id);
$client = $this->askForClient($output, $input);
if (!$client) {
$output->error('Client not found.');
return SCommand::FAILURE;
@@ -53,6 +35,9 @@ class Add extends Command
return $input;
});
/** @var QuestionHelper $helper */
$helper = $this->getHelper('question');
$email = $helper->ask($input, $output, $emailQuestion);
/** @var User| null $user */