mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-28 21:59:48 +00:00
Refactored logging message
This commit is contained in:
parent
d96b168ee6
commit
1024c1de71
@ -1,3 +1,4 @@
|
||||
use log::info;
|
||||
use once_cell::sync::Lazy;
|
||||
use rand::{RngCore, SeedableRng};
|
||||
use rocket::http::Status;
|
||||
@ -8,7 +9,11 @@ pub static API_TOKEN: Lazy<APIToken> = Lazy::new(|| {
|
||||
let mut token = [0u8; 32];
|
||||
let mut rng = rand_chacha::ChaChaRng::from_entropy();
|
||||
rng.fill_bytes(&mut token);
|
||||
APIToken::from_bytes(token.to_vec())
|
||||
|
||||
let token = APIToken::from_bytes(token.to_vec());
|
||||
info!("API token was generated successfully.");
|
||||
|
||||
token
|
||||
});
|
||||
|
||||
pub struct APIToken {
|
||||
|
@ -37,6 +37,7 @@ pub static ENCRYPTION: Lazy<Encryption> = Lazy::new(|| {
|
||||
rng.fill_bytes(&mut secret_key);
|
||||
rng.fill_bytes(&mut secret_key_salt);
|
||||
|
||||
info!("Secret password for the IPC channel was generated successfully.");
|
||||
Encryption::new(&secret_key, &secret_key_salt).unwrap()
|
||||
});
|
||||
|
||||
|
@ -139,8 +139,7 @@ async fn main() {
|
||||
.ignite().await.unwrap()
|
||||
.launch().await.unwrap();
|
||||
});
|
||||
|
||||
info!("Secret password for the IPC channel was generated successfully.");
|
||||
|
||||
start_dotnet_server(*API_SERVER_PORT);
|
||||
start_tauri();
|
||||
}
|
Loading…
Reference in New Issue
Block a user