Make axum-login crate optional

This commit is contained in:
2024-04-11 17:54:17 -04:00
parent a659564c91
commit 90d645a151
3 changed files with 8 additions and 15 deletions

View File

@ -1,15 +1,7 @@
use cfg_if::cfg_if;
cfg_if! {
if #[cfg(feature = "ssr")] {
use async_trait::async_trait;
use axum_login::{AuthnBackend, UserId};
use crate::users::UserCredentials;
use leptos::server_fn::error::ServerFnErrorErr;
}
}
use axum_login::AuthUser;
use async_trait::async_trait;
use axum_login::{AuthnBackend, AuthUser, UserId};
use crate::users::UserCredentials;
use leptos::server_fn::error::ServerFnErrorErr;
use crate::models::User;

View File

@ -12,11 +12,11 @@ pub mod users;
pub mod search;
pub mod fileserv;
pub mod error_template;
pub mod auth_backend;
use cfg_if::cfg_if;
cfg_if! {
if #[cfg(feature = "ssr")] {
if #[cfg(feature = "ssr")] {
pub mod auth_backend;
pub mod schema;
}
}