tymondesigns / jwt-auth

🔐 JSON Web Token Authentication for Laravel & Lumen
https://jwt-auth.com
MIT License
11.32k stars 1.54k forks source link

Dynamic authenticate key #2223

Open aemaddin opened 1 year ago

aemaddin commented 1 year ago

Sometimes you need to add a custom claim key that should be used instead of sub to retrieve the user by id on authenticate method and user method.

You just need to add a new .env key called JWT_IDENTIFIER that could be any claim key for example uid