SeraphJACK / SimpleLogin

Auth mod based on forge for Minecraft 1.12+
https://www.curseforge.com/minecraft/mc-mods/simple-login
MIT License
51 stars 23 forks source link

[Feature request] Storing password outside config #13

Closed Tander closed 4 years ago

Tander commented 4 years ago

Configurable path for storing password would be useful for modpacks with auto-update (which usually erases /config/ in the process). For example it can work this way:

  1. Looking for config in /config/
  2. If there is parameter (for example) customPath = "../folderForPassword/password.toml" then go to that location, otherwise work this config in /config/.
SeraphJACK commented 4 years ago

If the config file will be erased, the constomPath field in the file will be erased too.

Tander commented 4 years ago

Not if config will be rewritten by updater. Well, alternatively you can just store password in "root" folder (next to options.txt), but i'm not sure if other users of mod will be happy with that change. But storing password in config is a bit of pain in the neck for modpack makers, so it would be nice to have an option to change it somehow.

SeraphJACK commented 4 years ago

What about detecting whether a file in a specific path exists and if then read the password from it. For example, minecraft_folder/.sl_password.

SeraphJACK commented 4 years ago

Besides, I'm wondering why modpack makers need to publish their modpacks with this mod?

Tander commented 4 years ago

Yeah, it's basically what I suggested in a message above. So i'm totally agree with this. But two important notes:

  1. The path to file with password should be relative, not {user_home}/.minecraft, because many launchers (like curseforge or multimc) use alternative path for storing minecraft files.
  2. Considering amount of downloads of your mod, it would be good idea to think about backward compatibility. People shouldn't find themselves in a situation when they lost their passwords with mod update.
Tander commented 4 years ago

Besides, I'm wondering why modpack makers need to publish their modpacks with this mod?

In my case, I'm making a modpack for my local community, to play together. But sure, most of pack makers don't put your mod in a pack. But users do, so the problem is still here: they can lost their passwords with modpack update.

SeraphJACK commented 4 years ago

I'm always thinking about backward compatibility, I'll sure make it compatible with old versions. If there's any breaking change, I'll highlight it in the changelog.

So that's the idea to store the password aside from the configuration file, I'll implement it when I have spare time. I'm currently occupied by real-life affairs though.

SeraphJACK commented 4 years ago

New beta released.