1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-11-20 12:02:22 +03:00

Switch the policies to a violation list based approach

This allows policies to give proper feedback on form fields
This commit is contained in:
Quentin Gliech
2022-06-03 11:59:56 +02:00
parent 88c2625dc0
commit 7c8893e596
9 changed files with 185 additions and 64 deletions

View File

@@ -119,8 +119,8 @@ pub(crate) async fn post(
}
let mut policy = policy_factory.instantiate().await?;
let allowed = policy.evaluate_client_registration(&body).await?;
if !allowed {
let res = policy.evaluate_client_registration(&body).await?;
if !res.valid() {
return Err(RouteError::PolicyDenied);
}