aboutsummaryrefslogtreecommitdiff
path: root/src/components/user_settings/user_settings.js
diff options
context:
space:
mode:
authorkaniini <ariadne@dereferenced.org>2019-11-08 02:21:19 +0000
committerkaniini <ariadne@dereferenced.org>2019-11-08 02:21:19 +0000
commite0a1b14eaba7699f47b4f76fc6482a28b3b63d7d (patch)
tree64c6fcd0b29f494f17fff314ea2b771f6868eb10 /src/components/user_settings/user_settings.js
parent326b2416a0779957e2336a117d26aee9bde89bc4 (diff)
parente3381cdef1b410aafce15f2d2f1caeccbfae7c87 (diff)
Merge branch 'feature/change-email' into 'develop'
Add ability to change user's email Closes pleroma#1297 See merge request pleroma/pleroma-fe!983
Diffstat (limited to 'src/components/user_settings/user_settings.js')
-rw-r--r--src/components/user_settings/user_settings.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js
index 32eb802e..3fdc5340 100644
--- a/src/components/user_settings/user_settings.js
+++ b/src/components/user_settings/user_settings.js
@@ -35,6 +35,7 @@ const MuteList = withSubscription({
const UserSettings = {
data () {
return {
+ newEmail: '',
newName: this.$store.state.users.currentUser.name,
newBio: unescape(this.$store.state.users.currentUser.description),
newLocked: this.$store.state.users.currentUser.locked,
@@ -56,6 +57,9 @@ const UserSettings = {
backgroundPreview: null,
bannerUploadError: null,
backgroundUploadError: null,
+ changeEmailError: false,
+ changeEmailPassword: '',
+ changedEmail: false,
deletingAccount: false,
deleteAccountConfirmPasswordInput: '',
deleteAccountError: false,
@@ -305,6 +309,22 @@ const UserSettings = {
}
})
},
+ changeEmail () {
+ const params = {
+ email: this.newEmail,
+ password: this.changeEmailPassword
+ }
+ this.$store.state.api.backendInteractor.changeEmail(params)
+ .then((res) => {
+ if (res.status === 'success') {
+ this.changedEmail = true
+ this.changeEmailError = false
+ } else {
+ this.changedEmail = false
+ this.changeEmailError = res.error
+ }
+ })
+ },
activateTab (tabName) {
this.activeTab = tabName
},