睜大眼睛看清楚
你的data={
client_id:2,
client_secret:'lmXnxs7rV2oQXBmXOmUadeHomdM5UKhEr5LTQgzz',
grant_type:'password',
username:this.email,
password:this.password
}
這是個grant 同意 ,所以要對到你的database的oauth_client資料表 Laravel Password Grant Client
而不是Laravel Personal Access Client
data={
client_id:2, <---------------------------- must be Laravel Password Grant Client id
client_secret:'lmXnxs7rV2oQXBmXOmUadeHomdM5UKhEr5LTQgzz', <---------------------------- must be Laravel Password Grant Client id
grant_type:'password',
username:this.email,
password:this.password
}
2.
resolve (2) go to AuthServiceProvider.php
keypoint:set expiration of token
Passport::tokensExpireIn(Carbon::now()->addDays(1));
You must to set token expiration cant be infinite
3.
檢查你的get的headers 有沒有token,沒有的話要加