Microservice to bring 2FA to self hosted PDSes

custom email directory

Changed files
+11 -3
src
+10 -2
src/main.rs
··· 133 133 AsyncSmtpTransport::<Tokio1Executor>::from_url(smtp_url.as_str())?.build(); 134 134 //Email templates setup 135 135 let mut hbs = Handlebars::new(); 136 - //TODO add an override to manually load in the hbs templates 137 - let _ = hbs.register_embed_templates::<EmailTemplates>(); 136 + 137 + let users_email_directory = env::var("GATEKEEPER_EMAIL_TEMPLATES_DIRECTORY"); 138 + if let Ok(users_email_directory) = users_email_directory { 139 + hbs.register_template_file( 140 + "two_factor_code.hbs", 141 + format!("{users_email_directory}/two_factor_code.hbs"), 142 + )?; 143 + } else { 144 + let _ = hbs.register_embed_templates::<EmailTemplates>(); 145 + } 138 146 139 147 let pds_base_url = 140 148 env::var("PDS_BASE_URL").unwrap_or_else(|_| "http://localhost:3000".to_string());
+1 -1
src/xrpc/com_atproto_server.rs
··· 205 205 } 206 206 } 207 207 208 - // Updating the acutal email address 208 + // Updating the actual email address by sending it on to the PDS 209 209 let uri = format!( 210 210 "{}{}", 211 211 state.pds_base_url, "/xrpc/com.atproto.server.updateEmail"