mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Refactor ResetPassword to remove thx page, a start
This commit is contained in:
parent
5c89fe545d
commit
28f85cce87
@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<div class="resetpwd-form">
|
||||
<div v-if="!showPageMessage">
|
||||
<b-container>
|
||||
<div class="header p-4" ref="header">
|
||||
<div class="header-body text-center mb-7">
|
||||
@ -45,11 +46,21 @@
|
||||
</b-row>
|
||||
</b-container>
|
||||
</div>
|
||||
<div v-else>
|
||||
<message
|
||||
:headline="$t('site.thx.errorTitle')"
|
||||
:subtitle="errorMessage"
|
||||
:buttonText="$t('settings.password.reset')"
|
||||
linkTo="/forgot-password/resetPassword"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import InputPasswordConfirmation from '@/components/Inputs/InputPasswordConfirmation'
|
||||
import { setPassword } from '@/graphql/mutations'
|
||||
import { queryOptIn } from '@/graphql/queries'
|
||||
import InputPasswordConfirmation from '@/components/Inputs/InputPasswordConfirmation'
|
||||
import Message from '@/components/Message/Message'
|
||||
|
||||
const textFields = {
|
||||
reset: {
|
||||
@ -64,9 +75,10 @@ const textFields = {
|
||||
button: 'settings.password.set',
|
||||
linkTo: '/login',
|
||||
},
|
||||
// Wolle: seems unused
|
||||
login: {
|
||||
headline: 'site.thx.errorTitle',
|
||||
subtitle: 'site.thx.activateEmail',
|
||||
subtitle: 'site.thx.activateEmail', // Wolle: error.backend.ERR_EMAIL_NOT_VALIDATED
|
||||
},
|
||||
}
|
||||
|
||||
@ -74,6 +86,7 @@ export default {
|
||||
name: 'ResetPassword',
|
||||
components: {
|
||||
InputPasswordConfirmation,
|
||||
Message,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -82,6 +95,8 @@ export default {
|
||||
passwordRepeat: '',
|
||||
},
|
||||
displaySetup: {},
|
||||
showPageMessage: false,
|
||||
errorMessage: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -107,13 +122,21 @@ export default {
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
this.toastError(error.message)
|
||||
let errorMessage
|
||||
// Wolle: how to solve this with error codes?
|
||||
if (
|
||||
error.message.match(
|
||||
/email was sent more than ([0-9]+ hours)?( and )?([0-9]+ minutes)? ago/,
|
||||
)
|
||||
)
|
||||
this.$router.push('/forgot-password/resetPassword')
|
||||
) {
|
||||
// Wolle: this.$router.push('/forgot-password/resetPassword')
|
||||
errorMessage = error.message
|
||||
} else {
|
||||
errorMessage = error.message
|
||||
}
|
||||
this.showPageMessage = true
|
||||
this.toastError(errorMessage)
|
||||
this.errorSubtitle = errorMessage
|
||||
})
|
||||
},
|
||||
checkOptInCode() {
|
||||
@ -126,6 +149,7 @@ export default {
|
||||
})
|
||||
.then()
|
||||
.catch((error) => {
|
||||
// Wolle: show message as well?
|
||||
this.toastError(error.message)
|
||||
this.$router.push('/forgot-password/resetPassword')
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user