Make async-trait required for backend only
This commit is contained in:
parent
eb4dcd4776
commit
9a462d5ee9
@ -32,7 +32,7 @@ tower = { version = "0.4.13", optional = true }
|
||||
tower-http = { version = "0.5", optional = true, features = ["fs"] }
|
||||
thiserror = "1.0.57"
|
||||
tower-sessions-redis-store = { version = "0.11", optional = true }
|
||||
async-trait = "0.1.79"
|
||||
async-trait = { version = "0.1.79", optional = true }
|
||||
axum-login = { version = "0.14.0", optional = true }
|
||||
log = { version = "0.4.21", optional = true }
|
||||
flexi_logger = { version = "0.28.0", optional = true, default-features = false }
|
||||
@ -64,6 +64,7 @@ ssr = [
|
||||
"tower",
|
||||
"tower-http",
|
||||
"tower-sessions-redis-store",
|
||||
"async-trait",
|
||||
"axum-login",
|
||||
"log",
|
||||
"flexi_logger",
|
||||
|
@ -1,10 +1,17 @@
|
||||
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;
|
||||
|
||||
use cfg_if::cfg_if;
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(feature = "ssr")] {
|
||||
use async_trait::async_trait;
|
||||
}
|
||||
}
|
||||
|
||||
impl AuthUser for User {
|
||||
type Id = i32;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user