adding helper function to aid in creation of members as opt create owner
requires
This commit is contained in:
parent
ba433c5abe
commit
c1b50bd36a
@ -57,3 +57,15 @@ pub async fn wall_entry(path: &str, pool: &Pool, params: &mut serde_json::Value)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn generate_secret() -> String {
|
||||||
|
/*
|
||||||
|
* Generates a url-safe-plaintext secret for our db
|
||||||
|
* */
|
||||||
|
use getrandom::getrandom;
|
||||||
|
use base64::{encode_config, URL_SAFE};
|
||||||
|
|
||||||
|
let mut buf: Vec<u8> = vec![0;64];
|
||||||
|
getrandom(&mut buf);
|
||||||
|
encode_config(buf,URL_SAFE)
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user