automatic verified email when using proxy authentication

This commit is contained in:
Niels Bouma
2024-11-05 15:51:50 +01:00
parent 54a632f334
commit 4e365e8000
2 changed files with 8 additions and 3 deletions

View File

@@ -52,15 +52,20 @@ function stripEmailExtension(string $email): string
*
* @return \App\Models\User
*/
function createUser(string $username, string $email, string|null $password = null)
function createUser(string $username, string $email, string|null $password = null, bool $emailVerified = false)
{
$userId = Uuid::uuid4();
$recipient = Recipient::create([
'email' => $email,
'user_id' => $userId,
'user_id' => $userId,
]);
if ($emailVerified)
{
$recipient->markEmailAsVerified();
}
$usernameModel = Username::create([
'username' => $username,
'user_id' => $userId,