Basics of auth
Some checks failed
🧪✨ Tests Workflow / 🛡️ 🔒 License Check (push) Successful in 54s
🧪✨ Tests Workflow / 🧪 ✨ Database Migrations (push) Failing after 1m4s
🧪✨ Tests Workflow / 🛡️ 🔒 Library Audit (push) Successful in 1m14s
🧪✨ Tests Workflow / 📝 ✨ Code Lint (push) Successful in 1m10s
🧪✨ Tests Workflow / 🐙 🔍 Code Sniffer (push) Successful in 1m19s
🧪✨ Tests Workflow / 🧪 ✅ Unit Tests (push) Failing after 1m12s

This commit is contained in:
2026-01-02 15:01:26 -05:00
parent b5b6caa400
commit fc6e493355
21 changed files with 51 additions and 189 deletions

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace Siteworxpro\App\Cli\Commands\User;
use Illuminate\Database\Eloquent\Collection;
use Siteworxpro\App\Cli\Commands\Command;
use Siteworxpro\App\Models\ClientUser;
use Siteworxpro\App\Models\User;
@@ -18,6 +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']);
@@ -51,6 +53,7 @@ class Add extends Command
$email = $helper->ask($input, $output, $emailQuestion);
/** @var User| null $user */
$user = User::where('email', $email)->first();
if ($user) {
$output->yellow('A user with this email already exists. Associating the user with the client.');