Changes Made
If an OAuth token needed refreshed, it would be refreshed at the start of the program, and saved to disk at the end. This caused problems if fj is killed with Ctrl+C, or if another instance of fj is run before the first one finishes. Both of these result in the refresh token being used up but the new one not being saved, so further attempts to refresh it fail.
This is now all avoided by immediately saving the new token to disk.
Fixes #406
Code of Conduct
- I agree to act in accordance with the CoC & AI Agreement.
- This contribution was not generated by an LLM, even in part.