JWT update

Fixed JWT package issue
This commit is contained in:
Manish Verma
2018-08-09 18:18:57 +05:30
parent b3196c4fa1
commit 910c82567e
2 changed files with 301 additions and 130 deletions

View File

@@ -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 [];
}
}