Skip to content

Commit

Permalink
fix: refresh after attacker token test role update
Browse files Browse the repository at this point in the history
  • Loading branch information
TangoBeeAkto committed Dec 24, 2024
1 parent bd8e0b5 commit ef671d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ public String updateTestRoles() {
isAttackerRole = role.getId().equals(attackerRole.getId());
}
if (isAttackerRole) {
addActionError("Unable to update endpoint conditions for attacker role");
return ERROR.toUpperCase();
this.orConditions = null;
this.andConditions = null;
}

Conditions orConditions = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function TestRoleSettings() {
const saveAction = async (updatedAuth=false, authWithCondLists = null) => {
let andConditions = transform.filterContainsConditions(conditions, 'AND')
let orConditions = transform.filterContainsConditions(conditions, 'OR')
if (!(andConditions || orConditions) || roleName.length === 0) {
if (roleName !== 'ATTACKER_TOKEN_ALL' && !(andConditions || orConditions) || roleName.length === 0) {
func.setToast(true, true, "Please select valid values for a test role")
} else {
if (isNew) {
Expand Down Expand Up @@ -235,7 +235,7 @@ function TestRoleSettings() {
}
}

const conditionsCard = (
const conditionsCard = roleName !== 'ATTACKER_TOKEN_ALL' ? (
<LegacyCard title="Details" key="condition">
<TestRolesConditionsPicker
title="Role endpoint conditions"
Expand All @@ -245,7 +245,7 @@ function TestRoleSettings() {
selectOptions={selectOptions}
/>
</LegacyCard>
)
) : (<></>)

const deleteModalComp = (
<Modal
Expand Down

0 comments on commit ef671d2

Please sign in to comment.