···8888#[tokio::main]
8989async fn main() -> Result<(), Box<dyn std::error::Error>> {
9090 setup_tracing();
9191- //TODO may need to change where this reads from? Like an env variable for it's location? Or arg?
9292- dotenvy::from_path(Path::new("./pds.env"))?;
9191+ let pds_env_location =
9292+ env::var("PDS_ENV_LOCATION").unwrap_or_else(|_| "/pds/pds.env".to_string());
9393+9494+ dotenvy::from_path(Path::new(&pds_env_location))?;
9395 let pds_root = env::var("PDS_DATA_DIRECTORY")?;
9496 let account_db_url = format!("{pds_root}/account.sqlite");
9597···129131 env::var("PDS_EMAIL_SMTP_URL").expect("PDS_EMAIL_SMTP_URL is not set in your pds.env file");
130132 let sent_from = env::var("PDS_EMAIL_FROM_ADDRESS")
131133 .expect("PDS_EMAIL_FROM_ADDRESS is not set in your pds.env file");
134134+135135+ //TODO current bug running in docker
136136+ // https://github.com/lettre/lettre/issues/349#issuecomment-510155500
137137+132138 let mailer: AsyncSmtpTransport<Tokio1Executor> =
133139 AsyncSmtpTransport::<Tokio1Executor>::from_url(smtp_url.as_str())?.build();
134140 //Email templates setup
+1-4
src/oauth_provider.rs
···3636 "Invalid identifier or password",
3737 ),
3838 AuthResult::TwoFactorRequired(masked_email) => {
3939- // Email sending step can be handled here if needed in the future.
4040-4141- // {"error":"second_authentication_factor_required","error_description":"emailOtp authentication factor required (hint: 2***0@p***m)","type":"emailOtp","hint":"2***0@p***m"}
4239 let body_str = match serde_json::to_string(&serde_json::json!({
4340 "error": "second_authentication_factor_required",
4441 "error_description": format!("emailOtp authentication factor required (hint: {})", masked_email),
···9794 },
9895 Err(err) => {
9996 log::error!(
100100- "Error during pre-auth check. This happens on the create_session endpoint when trying to decide if the user has access:\n {err}"
9797+ "Error during pre-auth check. This happens on the oauth signin endpoint when trying to decide if the user has access:\n {err}"
10198 );
10299 oauth_json_error_response(
103100 StatusCode::BAD_REQUEST,