Fix: change password.
This commit is contained in:
@@ -141,6 +141,7 @@ const PerfilContent = ({ config }) => {
|
|||||||
const [newPasswordData, setNewPasswordData] = useState({
|
const [newPasswordData, setNewPasswordData] = useState({
|
||||||
oldPassword: "",
|
oldPassword: "",
|
||||||
newPassword: "",
|
newPassword: "",
|
||||||
|
confirmNewPassword: "",
|
||||||
serviceId: identity.account.serviceId
|
serviceId: identity.account.serviceId
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -161,13 +162,14 @@ const PerfilContent = ({ config }) => {
|
|||||||
await postData(config.changePasswordUrl, {
|
await postData(config.changePasswordUrl, {
|
||||||
oldPassword: newPasswordData.oldPassword,
|
oldPassword: newPasswordData.oldPassword,
|
||||||
newPassword: newPasswordData.newPassword,
|
newPassword: newPasswordData.newPassword,
|
||||||
serviceId: identity.user.account.serviceId
|
serviceId: identity.account.serviceId
|
||||||
});
|
});
|
||||||
|
|
||||||
setNewPasswordData({
|
setNewPasswordData({
|
||||||
oldPassword: "",
|
oldPassword: "",
|
||||||
newPassword: "",
|
newPassword: "",
|
||||||
serviceId: identity.user.account.serviceId
|
confirmNewPassword: "",
|
||||||
|
serviceId: identity.account.serviceId
|
||||||
});
|
});
|
||||||
|
|
||||||
setFeedbackModal({
|
setFeedbackModal({
|
||||||
@@ -320,7 +322,7 @@ const PerfilContent = ({ config }) => {
|
|||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
type={showOld ? "text" : "password"}
|
type={showOld ? "text" : "password"}
|
||||||
placeholder=""
|
placeholder=""
|
||||||
name="currentPassword"
|
name="oldPassword"
|
||||||
className="rounded-4"
|
className="rounded-4"
|
||||||
isInvalid={!!fieldErrors?.oldPassword}
|
isInvalid={!!fieldErrors?.oldPassword}
|
||||||
/>
|
/>
|
||||||
@@ -390,7 +392,7 @@ const PerfilContent = ({ config }) => {
|
|||||||
<Button
|
<Button
|
||||||
disabled={newPasswordData.newPassword !== newPasswordData.confirmNewPassword ||
|
disabled={newPasswordData.newPassword !== newPasswordData.confirmNewPassword ||
|
||||||
newPasswordData.newPassword === '' || newPasswordData.confirmNewPassword === '' ||
|
newPasswordData.newPassword === '' || newPasswordData.confirmNewPassword === '' ||
|
||||||
newPasswordData.currentPassword === ''
|
newPasswordData.oldPassword === ''
|
||||||
}
|
}
|
||||||
type='submit'
|
type='submit'
|
||||||
variant="warning"
|
variant="warning"
|
||||||
|
|||||||
Reference in New Issue
Block a user