Skip to content

Commit

Permalink
Merge pull request #1959 from GluuFederation/admin-ui-issue-1958
Browse files Browse the repository at this point in the history
fix(admin-ui): password should be hidden in audit logs.
  • Loading branch information
duttarnab authored Jan 4, 2025
2 parents a078f14 + 341184d commit e707ff2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function UserAddPage() {
}
}

const submitData = (values) => {
const submitData = (values, modifiedFields, message) => {
let customAttributes = createCustomAttributes(values)
let submitableValues = {
userId: values.userId || '',
Expand All @@ -72,6 +72,7 @@ function UserAddPage() {
userPassword: values.userPassword || '',
givenName: values.givenName || '',
customAttributes: customAttributes,
action_message: message,
}
dispatch(createUser(submitableValues))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function UserForm({ onSubmitData }) {

const submitForm = (usermessage) => {
toggle();
onSubmitData(formik.values, modifiedFields,usermessage);
onSubmitData(formik.values, modifiedFields, usermessage);
};
const loading = useSelector((state) => state.userReducer.loading);
const setSelectedClaimsToState = (data) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ function UserList(props) {
const [userDetails, setUserDetails] = useState(false);
const [deleteData, setDeleteData] = useState(null);
const toggle = () => setModal(!modal);
const submitForm = () => {
const submitForm = (message) => {
toggle();
deleteData.action_message = message;
handleUserDelete(deleteData);
};
const theme = useContext(ThemeContext);
Expand Down
6 changes: 4 additions & 2 deletions admin-ui/plugins/user-management/redux/sagas/UserSaga.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ export function* createUserSaga({ payload }) {
yield* triggerWebhook({ payload: { createdFeatureValue: data } });

addAdditionalData(audit, CREATE, API_USERS, payload);
audit.message = payload.action?.action_message || ``;
audit.message = payload?.action_message || ``;

delete payload.userPassword
yield call(postUserAction, audit);
return data;
} catch (e) {
Expand Down Expand Up @@ -163,7 +165,7 @@ export function* deleteUserSaga({ payload }) {
yield* triggerWebhook({ payload: { createdFeatureValue: payload } });

addAdditionalData(audit, DELETION, API_USERS, payload);
audit.message = `Deleted user ${payload.inum}`;
audit.message = payload.action_message || ``;
yield call(postUserAction, audit);
return data;
} catch (e) {
Expand Down

0 comments on commit e707ff2

Please sign in to comment.