aboutsummaryrefslogtreecommitdiff
path: root/src/components/user_settings/user_settings.js
diff options
context:
space:
mode:
authorSyldexia <syldexia@ofthewi.red>2018-05-21 23:01:09 +0100
committerSyldexia <syldexia@ofthewi.red>2018-05-21 23:01:09 +0100
commite0ba6a587671c4e7d484152f35076c0fb1eb2996 (patch)
treee3bb0c4b0ef2316a7cc9b30f6e514b55a14651c3 /src/components/user_settings/user_settings.js
parentf06fef26b169a07d95afbf1d40764f9196ee37de (diff)
Added change password to user settings
Diffstat (limited to 'src/components/user_settings/user_settings.js')
-rw-r--r--src/components/user_settings/user_settings.js22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js
index 1e7b9b12..b6026e18 100644
--- a/src/components/user_settings/user_settings.js
+++ b/src/components/user_settings/user_settings.js
@@ -13,7 +13,10 @@ const UserSettings = {
previews: [ null, null, null ],
deletingAccount: false,
deleteAccountConfirmPasswordInput: '',
- deleteAccountError: false
+ deleteAccountError: false,
+ changePasswordInputs: [ '', '', '' ],
+ changedPassword: false,
+ changePasswordError: false
}
},
components: {
@@ -195,6 +198,23 @@ const UserSettings = {
this.deleteAccountError = res.error
}
})
+ },
+ changePassword () {
+ const params = {
+ password: this.changePasswordInputs[0],
+ newPassword: this.changePasswordInputs[1],
+ newPasswordConfirmation: this.changePasswordInputs[2]
+ }
+ this.$store.state.api.backendInteractor.changePassword(params)
+ .then((res) => {
+ if (res.status === 'success') {
+ this.changedPassword = true
+ this.changePasswordError = false
+ } else {
+ this.changedPassword = false
+ this.changePasswordError = res.error
+ }
+ })
}
}
}