summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYummyOreo <bobgim20@gmail.com>2023-06-06 00:58:38 -0500
committerGitHub <noreply@github.com>2023-06-06 06:58:38 +0100
commit3593f5199030ca599a81ef3f39331ac0a2b8feba (patch)
treef1e5b274af30511399a42d04fb2f57839e14124c
parentf499ae84ed58b4ee33f1447d768cec9cf1cb2d8b (diff)
feat: do not allow empty passwords durring account creation (#1029)
* feat: do not allow empty passwords durring account creation * refactor: rustfmt
-rw-r--r--atuin/src/command/client/account/register.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/atuin/src/command/client/account/register.rs b/atuin/src/command/client/account/register.rs
index 6b51fac8..d306a141 100644
--- a/atuin/src/command/client/account/register.rs
+++ b/atuin/src/command/client/account/register.rs
@@ -1,5 +1,5 @@
use clap::Parser;
-use eyre::Result;
+use eyre::{bail, Result};
use tokio::{fs::File, io::AsyncWriteExt};
use atuin_client::{api_client, settings::Settings};
@@ -35,6 +35,10 @@ pub async fn run(
.clone()
.unwrap_or_else(super::login::read_user_password);
+ if password.is_empty() {
+ bail!("please provide a password");
+ }
+
let session =
api_client::register(settings.sync_address.as_str(), &username, &email, &password).await?;