kanimaru/twitcher

Missing Client ID and Client Secret when Exporting

Opened this issue · 3 comments

Affected Version: 1.2

Problem:
When running Twitcher in the Editor for a project, everything works as expected. However, when exporting and distributing the project to other people, the project fails to load the Client ID and Client Secret.

Cause:
When looking through the problem, it comes down to the client id and secret being stored in the user:// folder, which is not bound together with the exported game, causing issues with not being able to find the information needed.

Possible Solution(s):
The Client ID and Secret can be written to the res:// folder as a configuration file, that needs to be included in the exported project. Currently, it's being stored as a Godot encrypted data file, but could easily be stored in a Custom Resource, with the secret being encrypted and stored a PackedByteArray in the resource file, keeping the encryption so the security of the client id and secret is not exposed.

Then how do you want to encrypt it / where is the key for the encryption saved? The reason to save that stuff in user was that noone accidently commits their client secret to the repository.

This is what Godot Recommends. As the .godot folder should not be committed to the Github repository, and most of the gitignore templates I know, have .godot folder ignored.
https://docs.godotengine.org/en/stable/tutorials/export/exporting_projects.html#configuration-files

Do you know how the content of the file should / would look like I don't find methods to write to it and I don't want to messup existing file formats when I would put the stuff into it?