- set social login credentials

- disallow registration refactoring
This commit is contained in:
Čarodej
2022-01-11 13:22:25 +01:00
parent 62cbcd14ed
commit 1c188081b3
23 changed files with 891 additions and 148 deletions

View File

@@ -1,6 +1,7 @@
<?php
namespace App\Users\Actions;
use App\Users\DTO\CreateUserData;
use App\Users\Models\User;
use App\Http\Controllers\Controller;
use Illuminate\Auth\Events\Registered;
@@ -17,17 +18,12 @@ class CreateNewUserAction extends Controller
/**
* Validate and create a new user.
*/
public function __invoke($data)
public function __invoke(CreateUserData $data)
{
$settings = get_settings([
'registration', 'user_verification', 'subscription_type',
'user_verification', 'subscription_type',
]);
// Check if account registration is enabled
if (! intval($settings['registration'])) {
abort(401);
}
// Create user
$user = User::create([
'password' => $data->password ? bcrypt($data->password) : null,