Skip to content

Commit

Permalink
Fix API user registration role
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbyiliev committed Jan 28, 2025
1 parent a96ac49 commit 42aacae
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions wave/src/Http/Controllers/API/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Validator;
use Spatie\Permission\Models\Role;
use Tymon\JWTAuth\Facades\JWTAuth;
use Wave\ApiKey;
use App\Models\User;
Expand Down Expand Up @@ -109,15 +108,11 @@ public function register(Request $request)
'password' => 'required|string|min:6|confirmed',
]);

// Get the Default role of a user
$role = Role::where('name', config('wave.default_user_role'))->first();

$user = User::create([
'name' => $request->name,
'email' => $request->email,
'username' => $request->username,
'password' => bcrypt($request->password),
'role_id' => $role->id,
]);

$credentials = ['email' => $request['email'], 'password' => $request['password']];
Expand Down

0 comments on commit 42aacae

Please sign in to comment.