Add password update route

This commit is contained in:
kolaente 2020-04-17 22:01:17 +02:00
parent 8ea70a07bb
commit d13c06aa88
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 15 additions and 6 deletions

View File

@ -1,5 +1,5 @@
<template>
<div class="loader-container" v-bind:class="{ 'is-loading': false}">
<div class="loader-container" v-bind:class="{ 'is-loading': passwordUpdateService.loading}">
<div class="card">
<header class="card-header">
<p class="card-header-title">
@ -12,26 +12,29 @@
<div class="field">
<label class="label" for="newPassword">New Password</label>
<div class="control">
<input class="input" type="password" id="newPassword" placeholder="The new password..." v-model="passwordUpdate.newPassword"/>
<input class="input" type="password" id="newPassword" placeholder="The new password..."
v-model="passwordUpdate.newPassword" @keyup.enter="updatePassword"/>
</div>
</div>
<div class="field">
<label class="label" for="newPasswordConfirm">New Password Confirmation</label>
<div class="control">
<input class="input" type="password" id="newPasswordConfirm" placeholder="Confirm your new password..." v-model="passwordConfirm"/>
<input class="input" type="password" id="newPasswordConfirm" placeholder="Confirm your new password..."
v-model="passwordConfirm" @keyup.enter="updatePassword"/>
</div>
</div>
<div class="field">
<label class="label" for="currentPassword">Current Password</label>
<div class="control">
<input class="input" type="password" id="currentPassword" placeholder="Your current password" v-model="passwordUpdate.oldPassword"/>
<input class="input" type="password" id="currentPassword" placeholder="Your current password"
v-model="passwordUpdate.oldPassword" @keyup.enter="updatePassword"/>
</div>
</div>
</form>
<div class="bigbuttons">
<button @click="updatePassword()" class="button is-primary is-fullwidth"
:class="{ 'is-loading': false}">
:class="{ 'is-loading': passwordUpdateService.loading}">
Save
</button>
</div>
@ -62,7 +65,7 @@
methods: {
updatePassword() {
if (this.passwordConfirm !== this.passwordUpdate.newPassword) {
this.error({message: 'The new password and its confirmation don\'t match.'})
this.error({message: 'The new password and its confirmation don\'t match.'}, this)
return
}

View File

@ -8,6 +8,7 @@ import LoginComponent from '@/components/user/Login'
import RegisterComponent from '@/components/user/Register'
import PasswordResetComponent from '@/components/user/PasswordReset'
import GetPasswordResetComponent from '@/components/user/RequestPasswordReset'
import UserSettingsComponent from '@/components/user/Settings'
// List Handling
import ShowListComponent from '@/components/lists/ShowList'
import NewListComponent from '@/components/lists/NewList'
@ -154,5 +155,10 @@ export default new Router({
name: 'migrateWunderlist',
component: WunderlistMigrationComponent,
},
{
path: '/user/settings',
name: 'userSettings',
component: UserSettingsComponent,
},
]
})