* -c now uses the name parameter given to it

* new branch for failure of secret generation
This commit is contained in:
shockrah 2020-11-21 13:21:44 -08:00
parent b15277348f
commit 1c1bb5f3cd

View File

@ -211,7 +211,8 @@ OPTIONS:
let owner_secret = auth::generate_secret();
// creation of owner should just dump straight to stdout since this fires
// from a commandline parameter anyway
match db::member::Member::add(&p, "owner sama uwu", &owner_secret, perms::OWNER).await {
if let Ok(enc_secret) = auth::encrypt_secret(&owner_secret) {
match db::member::Member::add(&p, owner_name, &enc_secret, perms::OWNER).await {
Ok(response) => {
match response {
db::Response::Row(owner) =>
@ -226,6 +227,10 @@ OPTIONS:
eprintln!("Could not communicate with the SQL server, check your configs!");
}
}
}
else {
eprintln!("Could not generate a proper secret");
}
//println!("{}", serde_json::to_string(&owner).unwrap());
p.disconnect();
}