Please stop deleting auth.json on failed authentication #35
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Between the issues from a few updates ago, to intermittent connection issues, there are quite a few reasons why the file would still be valid even after an authentication failure.
It would be nice not having to recreate the file every single time there's a failed auth, or remember to disable and then in the future re-enable my automation while my Internet is down for the next few days.
You can enable the DisableBrowserAuth config option to prevent the auth.json file from being deleted when you are using a legacy authentication method (docs).
Thank you, I appreciate the link, I wasn't aware of that particular change and I guess that fixes the issue, even though it feels more like a workaround than a fix..
It's seems silly to me that the default behavior is to delete that file on failure, I can't think of any other application which does that or why that even happens in the first place.
I can give a bit more insight into that since I wrote most, if not all, of the code for the new auth workflow. In versions >= 1.9.0, the config.json was replaced with config.conf. This was to make it easier for users to edit with fewer syntax errors. Any other files (including json files) are considered to be internal resources created and managed by OF-DL. They aren't meant to be created, edited, or deleted by users (e.g. auth.json, rules.json, chrome-data, etc).
Deleting the auth.json file when auth fails simply ensures that OF-DL doesn't try to authenticate with known invalid auth details. The auth.json file is also deleted when "Logout and Exit" menu option is selected. There are certainly other ways to do it, but they would require refactoring the code. As it is now, the DisableBrowserAuth serves the purpose of preventing changes to auth.json when using a legacy auth method.