martinstoeckli / SilentNotes

SilentNotes is a simple note taking app which respects your privacy.
https://www.martinstoeckli.ch/silentnotes
Mozilla Public License 2.0
238 stars 35 forks source link

New login after expired refresh token won't be stored. #186

Closed martinstoeckli closed 2 years ago

martinstoeckli commented 2 years ago

If the OAuth login fails because the refresh token expired (e.g. OneDrive after a 90 day period), a new login is correctly demanded from the user. After a successful new login, the new refresh token won't be saved to the settings, which results in repeated login requests.

martinstoeckli commented 2 years ago

The problem is, that the new tokens are stored to the session in a shallow copy of the settings. Before the new credentials are stored, a test checks whether there are any changes between the session and the stored settings, and therefore decides that storage can be skipped.