allowed login models and update of login controller
This commit is contained in:
@@ -160,11 +160,9 @@ class LoginController extends Controller
|
||||
} else {
|
||||
//Get the role for the character to be stored in the database
|
||||
$role = $this->GetRole(null, $eve_user->id);
|
||||
//Set the role for the user
|
||||
$this->SetRole($role, $eve_user->id);
|
||||
|
||||
//Create a user account
|
||||
return User::create([
|
||||
//Create the user account
|
||||
$user = User::create([
|
||||
'name' => $eve_user->getName(),
|
||||
'email' => null,
|
||||
'avatar' => $eve_user->avatar,
|
||||
@@ -174,6 +172,12 @@ class LoginController extends Controller
|
||||
'access_token' => $eve_user->token,
|
||||
'user_type' => $this->GetAccountType(null, $eve_user->id),
|
||||
]);
|
||||
|
||||
//Set the role for the user
|
||||
$this->SetRole($role, $eve_user->id);
|
||||
|
||||
//Create a user account
|
||||
return $user;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,15 +18,6 @@ class UserPermission extends Model
|
||||
|
||||
protected $table = 'user_permissions';
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for arrays
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
protected $guarded = [];
|
||||
|
||||
public function user() {
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\User;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class UserRole extends Model
|
||||
{
|
||||
// Table Name
|
||||
protected $table = 'user_roles';
|
||||
|
||||
// Timestamps
|
||||
public $timestamps = true;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'character_id',
|
||||
'role',
|
||||
];
|
||||
|
||||
public function user() {
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user