Guard admin assignment/removal against empty filter
This commit is contained in:
@@ -60,6 +60,8 @@ pub(super) async fn ldap_login(
|
|||||||
.await?;
|
.await?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// only perform admin add/remove check if admin_filter is set
|
||||||
|
if !services.config.ldap.admin_filter.is_empty() {
|
||||||
let is_tuwunel_admin = services
|
let is_tuwunel_admin = services
|
||||||
.admin
|
.admin
|
||||||
.user_is_admin(lowercased_user_id)
|
.user_is_admin(lowercased_user_id)
|
||||||
@@ -77,6 +79,7 @@ pub(super) async fn ldap_login(
|
|||||||
.revoke_admin(lowercased_user_id)
|
.revoke_admin(lowercased_user_id)
|
||||||
.await?;
|
.await?;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Ok(user_id)
|
Ok(user_id)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user