Getting exception while create Token using passport Laravel

2.6k Views Asked by At

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;

2

There are 2 best solutions below

2
On BEST ANSWER

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.

0
On

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.