Please stop deleting auth.json on failed authentication #35

Closed
opened 2025-06-22 15:26:00 +00:00 by TheRealBonusLevel · 3 comments

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.

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.
Collaborator

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).

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](https://docs.ofdl.tools/config/all-configuration-options/#disablebrowserauth)).

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.

> 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](https://docs.ofdl.tools/config/all-configuration-options/#disablebrowserauth)). 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.
Collaborator

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.

> 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.
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sim0n00ps/OF-DL#35
No description provided.