validate nym arg presence on `./sndev login` command (#956)

check to ensure that a nym is provided to the login command before
proceeding. if omitted, echo an error message, display the help
for the login command, then exit with a non-zero exit code
This commit is contained in:
SatsAllDay 2024-03-23 21:09:45 -04:00 committed by GitHub
parent 101926a8bc
commit 90c9e21ac4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions

5
sndev
View File

@ -318,6 +318,11 @@ USAGE
sndev__login() {
shift
if [ -z "$1" ]; then
echo "<nym> argument required"
sndev__help_login
exit 1
fi
# hardcode token for which is the hex digest of the sha256 of
# "SNDEV-TOKEN3_0W_PhDRZVanbeJsZZGIEljexkKoGbL6qGIqSwTjjI"
# next-auth concats the token with the secret from env and then sha256's it