Get token (#8)

Reviewed-on: #8
This commit was merged in pull request #8.
This commit is contained in:
2026-06-24 14:50:15 -04:00
parent 702fead8c8
commit b5bb605361
7 changed files with 193 additions and 28 deletions
+6 -5
View File
@@ -3,6 +3,7 @@ pub const SECONDS_TO_SLEEP: u64 = 5;
pub const APP_NAME: &str = "catapult";
#[derive(Clone, Debug)]
pub struct App {
pub api_url: String,
pub auth_url: String,
@@ -21,8 +22,8 @@ pub async fn load_app() -> Result<App, std::io::Error> {
let service_passphrase_env = envy::environment::get_env("SERVICE_PASSPHRASE").await;
let envs = vec![
auth_url_env,
api_url_env,
auth_url_env,
service_username_env,
service_passphrase_env,
];
@@ -41,10 +42,10 @@ pub async fn load_app() -> Result<App, std::io::Error> {
if envs_valid {
match textsender_models::config::auxiliary::load_config().await {
Ok(twilio_config) => Ok(App {
api_url: String::new(),
auth_url: String::new(),
service_username: String::new(),
service_passphrase: String::new(),
api_url: envs[0].value.clone(),
auth_url: envs[1].value.clone(),
service_username: envs[2].value.clone(),
service_passphrase: envs[3].value.clone(),
twilio_config: twilio_config,
}),
Err(err) => Err(err),