|
@ -8,7 +8,7 @@ |
|
|
<div class="field"> |
|
|
<div class="field"> |
|
|
<label class="label">Username</label> |
|
|
<label class="label">Username</label> |
|
|
<div class="control"> |
|
|
<div class="control"> |
|
|
<input class="input" type="text" v-model="user.username"> |
|
|
<input v-model="user.username" class="input" type="text"> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="field"> |
|
|
<div class="field"> |
|
@ -21,7 +21,7 @@ |
|
|
<div class="field"> |
|
|
<div class="field"> |
|
|
<label class="label">Email</label> |
|
|
<label class="label">Email</label> |
|
|
<div class="control"> |
|
|
<div class="control"> |
|
|
<input class="input" type="email" v-model="user.email"> |
|
|
<input v-model="user.email" class="input" type="email"> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
@ -31,26 +31,20 @@ |
|
|
<p class="title">Change Password</p> |
|
|
<p class="title">Change Password</p> |
|
|
<div class="field"> |
|
|
<div class="field"> |
|
|
<p class="control has-icons-left"> |
|
|
<p class="control has-icons-left"> |
|
|
<input class="input" type="password" placeholder="Current Password" v-model="user.currentPassword"> |
|
|
<input v-model="user.currentPassword" class="input" placeholder="Current Password" type="password"> |
|
|
<span class="icon is-small is-left"> |
|
|
<span class="icon is-small is-left"><i class="fas fa-lock"></i></span> |
|
|
<i class="fas fa-lock"></i> |
|
|
|
|
|
</span> |
|
|
|
|
|
</p> |
|
|
</p> |
|
|
</div> |
|
|
</div> |
|
|
<div class="field"> |
|
|
<div class="field"> |
|
|
<p class="control has-icons-left"> |
|
|
<p class="control has-icons-left"> |
|
|
<input class="input" type="password" placeholder="New Password" v-model="user.newPassword"> |
|
|
<input v-model="user.newPassword" class="input" placeholder="New Password" type="password"> |
|
|
<span class="icon is-small is-left"> |
|
|
<span class="icon is-small is-left"><i class="fas fa-lock"></i></span> |
|
|
<i class="fas fa-lock"></i> |
|
|
|
|
|
</span> |
|
|
|
|
|
</p> |
|
|
</p> |
|
|
</div> |
|
|
</div> |
|
|
<div class="field"> |
|
|
<div class="field"> |
|
|
<p class="control has-icons-left"> |
|
|
<p class="control has-icons-left"> |
|
|
<input class="input" type="password" placeholder="Confirm Password" v-model="user.repeatNewPassword"> |
|
|
<input v-model="user.repeatNewPassword" class="input" placeholder="Confirm Password" type="password"> |
|
|
<span class="icon is-small is-left"> |
|
|
<span class="icon is-small is-left"><i class="fas fa-lock"></i></span> |
|
|
<i class="fas fa-lock"></i> |
|
|
|
|
|
</span> |
|
|
|
|
|
</p> |
|
|
</p> |
|
|
</div> |
|
|
</div> |
|
|
<div class="field"> |
|
|
<div class="field"> |
|
@ -60,13 +54,13 @@ |
|
|
</button> |
|
|
</button> |
|
|
</p> |
|
|
</p> |
|
|
</div> |
|
|
</div> |
|
|
<div class="notification is-danger has-text-centered mt-5" v-if="msgError"> |
|
|
<div v-if="msgError" class="notification is-danger has-text-centered mt-5"> |
|
|
<b>{{ msgError }}</b> |
|
|
<b>{{ msgError }}</b> |
|
|
</div> |
|
|
</div> |
|
|
<div class="notification is-success has-text-centered mt-5" v-else-if="msgSuccess"> |
|
|
<div v-else-if="msgSuccess" class="notification is-success has-text-centered mt-5"> |
|
|
<b>{{ msgSuccess }}</b> |
|
|
<b>{{ msgSuccess }}</b> |
|
|
</div> |
|
|
</div> |
|
|
<div class="notification is-primary is-light mt-5" v-else> |
|
|
<div v-else class="notification is-primary is-light mt-5"> |
|
|
<p>According to the traditional advice—which is still good—a strong password:</p> |
|
|
<p>According to the traditional advice—which is still good—a strong password:</p> |
|
|
<ul> |
|
|
<ul> |
|
|
<li>Has 12 Characters, Minimum</li> |
|
|
<li>Has 12 Characters, Minimum</li> |
|
@ -92,7 +86,7 @@ interface UpdatedUser extends UserInterface { |
|
|
|
|
|
|
|
|
export default class Profile extends Vue { |
|
|
export default class Profile extends Vue { |
|
|
private user = <UpdatedUser>{}; |
|
|
private user = <UpdatedUser>{}; |
|
|
private date: string = ''; |
|
|
private date = ''; |
|
|
private msgSuccess = ''; |
|
|
private msgSuccess = ''; |
|
|
private msgError = ''; |
|
|
private msgError = ''; |
|
|
|
|
|
|
|
@ -117,21 +111,9 @@ export default class Profile extends Vue { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.$store.dispatch('updateUser', user) |
|
|
this.$store.dispatch('updateUser', user) |
|
|
.then(() => { |
|
|
.then(() => this.msgSuccess = 'User updated!') |
|
|
this.msgSuccess = 'User updated!'; |
|
|
.catch(() => this.msgError = this.$store.getters.getErrUser.response.data.errors.message || |
|
|
this.$router.push({ |
|
|
'Something went wrong!') |
|
|
name: 'Profile', |
|
|
|
|
|
params: {username: this.user.username} |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
.catch((err: any) => { |
|
|
|
|
|
this.msgError = err.data.errors.message || err.message || 'Something went wrong!'; |
|
|
|
|
|
this.$router.push({ |
|
|
|
|
|
name: 'Profile', |
|
|
|
|
|
params: {username: this.user.username} |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|