--create-owner flag now correctly gives back the actual secret value instead of the encrypted value
This commit is contained in:
parent
8661bcabe7
commit
063f2c7c48
@ -207,7 +207,6 @@ OPTIONS:
|
|||||||
|
|
||||||
if let Some(owner_name) = args.value_of("create-owner") {
|
if let Some(owner_name) = args.value_of("create-owner") {
|
||||||
let p = Pool::new(&env::var("DATABASE_URL").unwrap());
|
let p = Pool::new(&env::var("DATABASE_URL").unwrap());
|
||||||
eprintln!("Creating owner {{ {} }}...", owner_name);
|
|
||||||
let owner_secret = auth::generate_secret();
|
let owner_secret = auth::generate_secret();
|
||||||
// creation of owner should just dump straight to stdout since this fires
|
// creation of owner should just dump straight to stdout since this fires
|
||||||
// from a commandline parameter anyway
|
// from a commandline parameter anyway
|
||||||
@ -215,8 +214,10 @@ OPTIONS:
|
|||||||
match db::member::Member::add(&p, owner_name, &enc_secret, perms::OWNER).await {
|
match db::member::Member::add(&p, owner_name, &enc_secret, perms::OWNER).await {
|
||||||
Ok(response) => {
|
Ok(response) => {
|
||||||
match response {
|
match response {
|
||||||
db::Response::Row(owner) =>
|
db::Response::Row(mut owner) => {
|
||||||
println!("{}", serde_json::to_string(&owner).expect("SQL query passed but serde couldn't parse the data for some reason")),
|
owner.secret = owner_secret; // giving the secret itself back to the user
|
||||||
|
println!("{}", serde_json::to_string(&owner).expect("SQL query passed but serde couldn't parse the data for some reason"))
|
||||||
|
},
|
||||||
db::Response::Empty => {
|
db::Response::Empty => {
|
||||||
eprintln!("SQL server failed to return owner data, check configs and also the members table to make sure there's nothing there by accident");
|
eprintln!("SQL server failed to return owner data, check configs and also the members table to make sure there's nothing there by accident");
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user