Skip to content

Commit

Permalink
fix(plugin-form): force reset password when edit credential [FTI-6248] (
Browse files Browse the repository at this point in the history
  • Loading branch information
2eha0 authored Oct 11, 2024
1 parent 82693c7 commit b544a11
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1047,6 +1047,13 @@ const dynamicOrdering = ref<PluginOrdering>()
// The whole purpose of this function is to wait for the existing record to be loaded if editing
// We need to wait for this before we start attempting to build the schema
const initForm = (data: Record<string, any>): void => {
// FIXME: This is a workaround for the issue FTI-6248, it should be replaced with a better solution
// When editing a credential, ff the user saves the password without changing it, the password will be changed to the hashed password returned by the backend
// The modification here is to force users to reset the password
if (props.credential && data.password) {
data.password = ''
}
form.fields.id = data?.id || undefined
dynamicOrdering.value = data?.ordering
Expand Down

0 comments on commit b544a11

Please sign in to comment.