mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
SessionId is taken from .state.sessionId not from .sessionId.
This commit is contained in:
parent
6996856fa3
commit
18505716dc
@ -45,9 +45,9 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import loginAPI from '../../../apis/loginAPI'
|
||||
import InputPassword from '../../../components/Inputs/InputPassword'
|
||||
import InputPasswordConfirmation from '../../../components/Inputs/InputPasswordConfirmation'
|
||||
import { updateUserInfos } from '../../../graphql/queries'
|
||||
|
||||
export default {
|
||||
name: 'FormUserPasswort',
|
||||
@ -77,18 +77,23 @@ export default {
|
||||
this.form.passwordNewRepeat = ''
|
||||
},
|
||||
async onSubmit() {
|
||||
const result = await loginAPI.changePasswordProfile(
|
||||
this.$store.state.sessionId,
|
||||
this.$store.state.email,
|
||||
this.form.password,
|
||||
this.form.newPassword.password,
|
||||
)
|
||||
if (result.success) {
|
||||
this.$toasted.success(this.$t('site.thx.reset'))
|
||||
this.cancelEdit()
|
||||
} else {
|
||||
this.$toasted.error(result.result.message)
|
||||
}
|
||||
this.$apollo
|
||||
.query({
|
||||
query: updateUserInfos,
|
||||
variables: {
|
||||
sessionId: this.$store.state.sessionId,
|
||||
email: this.$store.state.email,
|
||||
password: this.form.password,
|
||||
newPassword: this.form.newPassword.password,
|
||||
},
|
||||
})
|
||||
.then(() => {
|
||||
this.$toasted.success(this.$t('site.thx.reset'))
|
||||
this.cancelEdit()
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$toasted.error(error.message)
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user