It would make sense that when you call auth Fetch, it will call the update tokens function if it was provided at a set interval, of maybe 5 minutes, or an interval that is provided, so it does it at an acceptable threshold for when the user is interacting with the page.
Also we want the user to be logged out at some point, so I think adding an option to forgo refresh if the auth token is already expired. It only makes sense to refresh if they haven't left the auth token with no activity long enough to expire.
It would make sense that when you call auth Fetch, it will call the update tokens function if it was provided at a set interval, of maybe 5 minutes, or an interval that is provided, so it does it at an acceptable threshold for when the user is interacting with the page.
Also we want the user to be logged out at some point, so I think adding an option to forgo refresh if the auth token is already expired. It only makes sense to refresh if they haven't left the auth token with no activity long enough to expire.
I like the project by the way!