adding helper function to aid in creation of members as opt create owner requires

This commit is contained in:
shockrah 2020-08-06 16:31:18 -07:00
parent ba433c5abe
commit c1b50bd36a

View File

@ -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)
}