diff options
| author | KunoiSayami <[email protected]> | 2022-10-23 10:24:37 +0800 |
|---|---|---|
| committer | KunoiSayami <[email protected]> | 2022-10-23 10:24:37 +0800 |
| commit | f43314c3dd296be154c928f68b1b8d2a0d01c78f (patch) | |
| tree | d924e68db020a554a8a0e468cb07bfd6d244dbc7 /src/main.rs | |
| parent | 4c58b52777aa8e1c9a8d8d20a4350be039bcdf90 (diff) | |
feat: Remove pam feature from default buildv4.0.0
Signed-off-by: KunoiSayami <[email protected]>
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index e3a347a..c8eff4b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -20,7 +20,9 @@ mod datastructures; #[cfg(test)] mod test; -use crate::datastructures::{AuthorizerType, Config, Cookie, FormData, TestSuite, WrapConfigure}; +#[cfg(feature = "pam")] +use crate::datastructures::AuthorizerType; +use crate::datastructures::{Config, Cookie, FormData, TestSuite, WrapConfigure}; use anyhow::Result; use clap::{Arg, ArgMatches, Command}; use handlebars::Handlebars; @@ -231,6 +233,13 @@ async fn cmd_init(cfg: Config) -> Result<()> { Ok(()) } +#[cfg(not(feature = "pam"))] +async fn verify_login(cfg: &WrapConfigure, data: &FormData) -> Result<bool> { + cfg.hook().await?; + data.authorize(cfg.get_authorizer()).await +} + +#[cfg(feature = "pam")] async fn verify_login(cfg: &WrapConfigure, data: &FormData) -> Result<bool> { if let AuthorizerType::Password = cfg.get_authorizer().method() { cfg.hook().await?; |
