JWT update
Fixed JWT package issue
This commit is contained in:
29
app/User.php
29
app/User.php
@@ -4,11 +4,12 @@ namespace App;
|
||||
|
||||
use Illuminate\Auth\Authenticatable;
|
||||
use Illuminate\Auth\Passwords\CanResetPassword;
|
||||
use Tymon\JWTAuth\Contracts\JWTSubject as AuthenticatableUserContract;
|
||||
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
|
||||
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class User extends Model implements AuthenticatableContract, CanResetPasswordContract
|
||||
class User extends Model implements AuthenticatableContract, CanResetPasswordContract, AuthenticatableUserContract
|
||||
{
|
||||
use Authenticatable,
|
||||
CanResetPassword;
|
||||
@@ -175,13 +176,23 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
||||
return $this->name();
|
||||
}
|
||||
|
||||
// public function save() {
|
||||
// dd($this->id);
|
||||
// parent::save();
|
||||
// }
|
||||
/**
|
||||
* Get the identifier that will be stored in the subject claim of the JWT.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getJWTIdentifier()
|
||||
{
|
||||
return $this->getKey();
|
||||
}
|
||||
|
||||
// public function save(array $options = array()) {
|
||||
// parent::save($options);
|
||||
// dd($this->where('id',$this->id)->select('first_name','last_name','user_name','email')->get()->toJson());
|
||||
// }
|
||||
/**
|
||||
* Return a key value array, containing any custom claims to be added to the JWT.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getJWTCustomClaims()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user