dusterio / lumen-passport

Making Laravel Passport work with Lumen
MIT License
654 stars 139 forks source link

Call to undefined method Lcobucci\\JWT\\Token\\Plain::getClaim() #148

Closed lloricode closed 3 years ago

lloricode commented 3 years ago
package version
php 7.4.11
dusterio/lumen-passport 0.3.1
laravel/passport 10.1.0
lcobucci/jwt 4.0.0

when updating to laravel/passport v10.1.0:

Call to undefined method Lcobucci\\JWT\\Token\\Plain::getClaim()

notice it update also lcobucci/jwt to ^4.0 https://github.com/lcobucci/jwt/releases/tag/4.0.0

our temporary fix is add this to project composer.json

 "lcobucci/jwt": "^3.4"

since laravel passport allow this

"lcobucci/jwt": "^3.4|^4.0",
aldoetobex commented 3 years ago

Hi @lloricode, I encountered the same error. Thanks for your temporary fix solution

chris-doehring commented 3 years ago

Unfortunetly, the workaround does not work when you want to use php 8. I created #150 which will fix the issue.

AliRazaLilani commented 1 year ago

if anyone still getting this error use this $verifiedIdToken->claims()->get('sub') instead of this $verifiedIdToken->getClaim('sub')