Monday, February 12, 2018

Redundant Database Query using JWTAuth and Laravel - development

Redundant Database Query using JWTAuth and Laravel

When using JWTAuth, every signed request sent to the API performs a database query retrieving the user, i.e.:

select * from `users` where `id` = '1' limit 1

For most of my routes, this query is redundant and I would like to remove it. In this pull request, there is a discussion about this topic. Although, I am already using a custom middleware, but I suppose the one supplied by JWTAuth is still there.

How do I remove the redundant user DB query?



from Laravel Questions and Answers https://laravelquestions.com/laravel/redundant-database-query-using-jwtauth-and-laravel/
via Lzo Media

No comments:

Post a Comment