mirror of
https://github.com/atuinsh/atuin.git
synced 2024-11-23 08:45:04 +01:00
feat: do not allow empty passwords durring account creation (#1029)
* feat: do not allow empty passwords durring account creation * refactor: rustfmt
This commit is contained in:
parent
f499ae84ed
commit
3593f51990
@ -1,5 +1,5 @@
|
|||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use eyre::Result;
|
use eyre::{bail, Result};
|
||||||
use tokio::{fs::File, io::AsyncWriteExt};
|
use tokio::{fs::File, io::AsyncWriteExt};
|
||||||
|
|
||||||
use atuin_client::{api_client, settings::Settings};
|
use atuin_client::{api_client, settings::Settings};
|
||||||
@ -35,6 +35,10 @@ pub async fn run(
|
|||||||
.clone()
|
.clone()
|
||||||
.unwrap_or_else(super::login::read_user_password);
|
.unwrap_or_else(super::login::read_user_password);
|
||||||
|
|
||||||
|
if password.is_empty() {
|
||||||
|
bail!("please provide a password");
|
||||||
|
}
|
||||||
|
|
||||||
let session =
|
let session =
|
||||||
api_client::register(settings.sync_address.as_str(), &username, &email, &password).await?;
|
api_client::register(settings.sync_address.as_str(), &username, &email, &password).await?;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user