tymondesigns / jwt-auth

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

Dynamic authenticate key #2223

Open aemaddin opened 11 months ago

aemaddin commented 11 months 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