Token refreshes after app is in background or closedand returns while access_token expiration duration has passed

I encountered the following situtation:

1st Sxenario
Having set Access Token to expire in 2 mins, if i login and stay inactive for 2 mins i got the error “token expired”. So it works as expected. :+1:

2nd Scenario
With the same setup upon login, instead of stay inactive, closing the tab. Waiting for 3 mins(token expired) and re opening the app token is being refreshed instead of firing token expiration event. :-1:

I wan to to configure keycloak calculate also the time that the app is closed (or in mobile device background). Can someone help me on this one?