mercredi 12 décembre 2018

Customize Passport Queries time of authenticating

For every request I found that 4 queries are fired to validate the user and the token. Among them one is to fetch the user (select * from user) based on the user id. This queries are fired by Passport/Laravel But what I want is to modify this query to add one status field check also to check if any user become invalid during the token validity period. If we only check with the id then if any user become inactive(By changing status then also we will not be able to stop the user as deleting the token for the user is not a good solution for me).

Queries Fired on every request by Passport Laravel:

select * from oauth_access_tokens where id = ? 
select * from user where id = ? limit 1 ["2"] 
select * from oauth_access_tokens where id = ? 
select * from oauth_clients where id = ?

So, can anyone tell me how to change the 'select * from user where id' query in passport at time of Token validation.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2BeCeJl
via IFTTT

Aucun commentaire:

Enregistrer un commentaire