This commit is contained in:
Andras Schmelczer 2025-04-04 21:48:27 +01:00
parent b5e528d8b8
commit 0e53631cc8
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C

View file

@ -17,7 +17,6 @@ use crate::{
errors::{SyncServerError, permission_denied_error, unauthenticated_error}, errors::{SyncServerError, permission_denied_error, unauthenticated_error},
}; };
pub async fn auth_middleware( pub async fn auth_middleware(
State(state): State<AppState>, State(state): State<AppState>,
Path(path_params): Path<HashMap<String, String>>, Path(path_params): Path<HashMap<String, String>>,
@ -37,11 +36,7 @@ pub async fn auth_middleware(
Ok(next.run(req).await) Ok(next.run(req).await)
} }
pub fn auth( pub fn auth(state: &AppState, token: &str, vault_id: &VaultId) -> Result<User, SyncServerError> {
state: &AppState,
token: &str,
vault_id: &VaultId,
) -> Result<User, SyncServerError> {
let user = state let user = state
.config .config
.users .users