This should re-allow anonymous users on systems that have that permission set.

This commit is contained in:
Herbert Wolverson 2024-07-19 11:32:01 -05:00
parent 6609f397eb
commit 564c266792

View File

@ -80,7 +80,15 @@ pub async fn auth_layer(
req.extensions_mut().insert(login_result); req.extensions_mut().insert(login_result);
Ok(next.run(req).await) Ok(next.run(req).await)
} }
LoginResult::Denied => Err(Html(BOUNCE)), LoginResult::Denied => {
let users = WebUsers::load_or_create().unwrap();
if users.do_we_allow_anonymous() {
req.extensions_mut().insert(LoginResult::ReadOnly);
Ok(next.run(req).await)
} else {
Err(Html(BOUNCE))
}
},
}; };
} }
Err(Html(BOUNCE)) Err(Html(BOUNCE))