diff --git a/client/components/Settings/Account.vue b/client/components/Settings/Account.vue index 68146c11..1d465337 100644 --- a/client/components/Settings/Account.vue +++ b/client/components/Settings/Account.vue @@ -15,6 +15,7 @@ , - required: true, - }, - }, - setup(props) { + setup() { const store = useStore(); const passwordErrors = { @@ -132,6 +129,10 @@ export default defineComponent({ error: keyof typeof passwordErrors; }>(); + const old_password = ref(""); + const new_password = ref(""); + const verify_password = ref(""); + const currentSession = computed(() => { return store.state.sessions.find((item) => item.current); }); @@ -149,12 +150,10 @@ export default defineComponent({ }); const changePassword = () => { - const allFields = new FormData(props.settingsForm); - const data = { - old_password: allFields.get("old_password"), - new_password: allFields.get("new_password"), - verify_password: allFields.get("verify_password"), + old_password: old_password.value, + new_password: new_password.value, + verify_password: verify_password.value, }; if (!data.old_password || !data.new_password || !data.verify_password) { @@ -189,6 +188,9 @@ export default defineComponent({ activeSessions, otherSessions, changePassword, + old_password, + new_password, + verify_password, }; }, });