Getting exception while create Token using passport Laravel

耗尽温柔 提交于 2020-12-12 11:48:13

问题


Everything is working fine till yesterday. But Today while login through api I am getting an exception while creating token. Exception is : Replicating claims as headers is deprecated and will removed from v4.0. Please manually set the header if you need it replicated.

I don't know where things go wrong. If you have any solution it will really appreciate it, Thanks.

code for creating token : $user->createToken('fullaccess')->accessToken;


回答1:


I too faced the same issue, a quick solution will be to downgrade the package lcobucci/jwt : 3.3 . It must have been upgraded to 3.4 during composer update which threw the deprecation warning.




回答2:


I'm deeply sorry for causing confusion or issues. Please check https://github.com/lcobucci/jwt/issues/550#issuecomment-733557709 for my full explanation on why this approach was taken and why it isn't considered a BC-break in my PoV.



来源:https://stackoverflow.com/questions/64999830/getting-exception-while-create-token-using-passport-laravel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!