Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

pllaguno's avatar

Passport Personal Access Token Refresh

I have an API working correctly already, and my Personal Access works well. I am trying to add a functionality since i need my token to expire in 1 hour but that every time a call is made for it to auto-renew for another hour, basically after every call the expire_at should update to 1 hour from now().

Is there a simple way to do this? something already coded on Passport?

0 likes
2 replies
mabdullahsari's avatar

This is bad practice. Why would you want to autorefresh every single time? What if you need to kick a client?

Hit the dedicated token refresh endpoint with your client once it has expired and just repeat this.

Please or to participate in this conversation.