FreeOTPPlus
FreeOTPPlus copied to clipboard
Json import overwrites token if it already exists
Proposition to fix #207
When importing from JSON, for every token from the JSON it will be checked if the token already exists (check for equality of issuer, label and secret). If the token already exists, only overwrite the token, else insert a new token.
Also the id of imported tokens should not be set to their index in the JSON, but should be generated.
If this proposition is supposed to be how the JSON Import should work, the displayed message import_json_file_warning:
All the current tokens will be cleared and overwritten after importing.
is misleading. The current tokens are not cleared, existing tokens might only get overwritten. If an existing token is not present in the JSON file it will not be cleared/deleted. Therefore I propose to change the text to e.g.:
The current tokens might be overwritten after importing.