Strip out JWT usage and use cookies to track the currently logged in user

This commit is contained in:
Dane Everitt 2018-07-14 22:42:58 -07:00
parent a7fae86e58
commit 6336e5191f
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
9 changed files with 44 additions and 144 deletions

View file

@ -5,6 +5,7 @@ namespace Pterodactyl\Models;
use Sofa\Eloquence\Eloquence;
use Sofa\Eloquence\Validable;
use Pterodactyl\Rules\Username;
use Illuminate\Support\Collection;
use Illuminate\Validation\Rules\In;
use Illuminate\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
@ -177,6 +178,16 @@ class User extends Model implements
return $rules;
}
/**
* Return the user model in a format that can be passed over to Vue templates.
*
* @return array
*/
public function toVueObject(): array
{
return (new Collection($this->toArray()))->except(['id', 'external_id'])->toArray();
}
/**
* Send the password reset notification.
*