@@ -9,13 +9,13 @@ use std::{sync::Arc, time::Duration};
9
9
use anyhow:: Context ;
10
10
use mas_config:: {
11
11
AccountConfig , BrandingConfig , CaptchaConfig , DatabaseConfig , EmailConfig , EmailSmtpMode ,
12
- EmailTransportKind , ExperimentalConfig , HomeserverKind , MatrixConfig , PasswordsConfig ,
13
- PolicyConfig , TemplatesConfig ,
12
+ EmailTransportKind , ExperimentalConfig , HomeserverKind , HttpConfig , MatrixConfig ,
13
+ PasswordsConfig , PolicyConfig , TemplatesConfig ,
14
14
} ;
15
15
use mas_context:: LogContext ;
16
16
use mas_data_model:: { SessionExpirationConfig , SiteConfig } ;
17
17
use mas_email:: { MailTransport , Mailer } ;
18
- use mas_handlers:: passwords:: PasswordManager ;
18
+ use mas_handlers:: { passwords:: PasswordManager , webauthn :: Webauthn } ;
19
19
use mas_matrix:: { HomeserverConnection , ReadOnlyHomeserverConnection } ;
20
20
use mas_matrix_synapse:: SynapseConnection ;
21
21
use mas_policy:: PolicyFactory ;
@@ -490,6 +490,16 @@ pub fn homeserver_connection_from_config(
490
490
}
491
491
}
492
492
493
+ pub fn webauthn_from_config (
494
+ http_config : & HttpConfig ,
495
+ experimental_config : & ExperimentalConfig ,
496
+ ) -> Result < Webauthn , anyhow:: Error > {
497
+ Webauthn :: new (
498
+ & http_config. public_base ,
499
+ experimental_config. passkeys . as_ref ( ) ,
500
+ )
501
+ }
502
+
493
503
#[ cfg( test) ]
494
504
mod tests {
495
505
use rand:: SeedableRng ;
0 commit comments