Skip to content

Commit

Permalink
Merge pull request #1318 from akto-api-security/hotfix/fix_updation_a…
Browse files Browse the repository at this point in the history
…uth_type

Fixed auth type updation and contextual bar settings
  • Loading branch information
avneesh-akto authored Aug 1, 2024
2 parents cdc5374 + 85b74ab commit db911e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,11 @@ public void run() {
}

public String updateCustomAuthTypeStatus(){
User user = getSUser();
customAuthType = CustomAuthTypeDao.instance.findOne(CustomAuthType.NAME,name);
if(customAuthType==null){
addActionError("Custom Auth Type does not exist");
return ERROR.toUpperCase();
} else if(user.getId()!=customAuthType.getCreatorId()){
addActionError("Unautherized Request");
return ERROR.toUpperCase();
} else {
} else {
CustomAuthTypeDao.instance.updateOne(Filters.eq(CustomAuthType.NAME, name),
Updates.combine(
Updates.set(CustomAuthType.ACTIVE, active),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,28 @@ function ContextualLayout(props){
url: '#',
accessibilityLabel: 'Akto Icon',
};

const disabledActive = isDisabled()
const contextualMarkup = (
<ContextualSaveBar
message="Unsaved changes"
saveAction={{
onAction: () => saveAction(),
loading: false,
disabled: isDisabled(),
disabled: disabledActive,
content: "Save"
}}
discardAction={{
onAction: () => discardAction(),
content: "Discard",
disabled: isDisabled(),
disabled: disabledActive,
}}
/>
)

return (
<div className='control-frame-padding'>
<Frame logo={logo}>
{contextualMarkup}
{!disabledActive ? contextualMarkup : null}
{pageMarkup}
</Frame>
</div>
Expand Down

0 comments on commit db911e9

Please sign in to comment.