feat: allow openid users to export their data without a password (#918)

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/frontend#918
Reviewed-by: dpschen <dpschen@noreply.kolaente.de>
Co-authored-by: konrad <k@knt.li>
Co-committed-by: konrad <k@knt.li>
This commit is contained in:
konrad 2021-10-31 13:16:28 +00:00
parent a515b0c3a4
commit 5b406b0172
2 changed files with 58 additions and 44 deletions

View File

@ -1,6 +1,7 @@
<template>
<div class="content">
<h1>{{ $t('user.export.downloadTitle') }}</h1>
<template v-if="isLocalUser">
<p>{{ $t('user.export.descriptionPasswordRequired') }}</p>
<div class="field">
<label class="label" for="currentPasswordDataExport">
@ -22,6 +23,7 @@
{{ $t('user.deletion.passwordRequired') }}
</p>
</div>
</template>
<x-button
v-focus
@ -48,9 +50,14 @@ export default {
created() {
this.dataExportService = new DataExportService()
},
computed: {
isLocalUser() {
return this.$store.state.auth.info?.isLocalUser
},
},
methods: {
download() {
if (this.password === '') {
if (this.password === '' && this.isLocalUser) {
this.errPasswordRequired = true
this.$refs.passwordInput.focus()
return

View File

@ -3,6 +3,7 @@
<p>
{{ $t('user.export.description') }}
</p>
<template v-if="isLocalUser">
<p>
{{ $t('user.export.descriptionPasswordRequired') }}
</p>
@ -26,6 +27,7 @@
{{ $t('user.deletion.passwordRequired') }}
</p>
</div>
</template>
<x-button
:loading="dataExportService.loading"
@ -48,12 +50,17 @@ export default {
errPasswordRequired: false,
}
},
computed: {
isLocalUser() {
return this.$store.state.auth.info?.isLocalUser
},
},
mounted() {
this.setTitle(`${this.$t('user.export.title')} - ${this.$t('user.settings.title')}`)
},
methods: {
async requestDataExport() {
if (this.password === '') {
if (this.password === '' && this.isLocalUser) {
this.errPasswordRequired = true
this.$refs.passwordInput.focus()
return