-
-
Notifications
You must be signed in to change notification settings - Fork 512
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow using existing key file on login (#688)
* Allow logging in without overwriting existing key file If the given key on login in empty, keep the existing key file rather than overwriting it with an empty file. This is useful if you log out and want to log in again and still use the same key, or if you have copied over the key file rather than providing it as input. * Refuse logging in if key is empty Before the previous commit, an empty key file would be created if key wasn't specified, and after the previous commit, the key file would not be created if the key wasn't specified and stay empty if it was empty. Now the log command checks the key file if a key is not specified and exits with an error message if either the key file couldn't be opened or is empty. If a key is specified, the key file is just created with it as before. * Validate the key on login, create new if no exists After reading the key either from an existing key file, or from the user input, validate that the provided key is valid (rather than just checking that it isn't empty). If no key file exists, create a new key instead of erroring out.
- Loading branch information
Showing
1 changed file
with
53 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters