Fix no-license UUID bug

This commit fixes a registration bug while license requirements are off.
Since the app always expects a UUID, it would error out without one.
This commit is contained in:
2021-10-20 03:43:58 +01:00
parent 2ca891b3b0
commit 5ff96143a7
6 changed files with 7 additions and 21 deletions

View File

@@ -120,16 +120,13 @@ class RegisterController extends Controller
protected function create(array $data)
{
$user = User::create([
'uuid' => $data['uuid'],
'uuid' => $data['uuid'] ?? "disabled",
'name' => $data['name'],
'email' => $data['email'],
'password' => Hash::make($data['password']),
'originalIP' => config('demo.is_enabled') ? '0.0.0.0' : request()->ip(),
]);
// It's not the registration controller's concern to create a profile for the user,
// so this code has been moved to its respective observer, following the separation of concerns pattern.
$user->assignRole('user');
return $user;