99 @submit.prevent =" send()"
1010 @closing =" signMethodsStore.closeModal('createPassword')" >
1111 <p >{{ t('libresign', 'For security reasons, you must create a password to sign the documents. Enter your new password in the field below.') }}</p >
12+ <NcNoteCard v-if =" errorMessage" type =" error" >
13+ {{ errorMessage }}
14+ </NcNoteCard >
1215 <NcPasswordField v-model =" password"
1316 :disabled =" hasLoading"
1417 :label =" t('libresign', 'Enter a password')"
2932
3033<script >
3134import axios from ' @nextcloud/axios'
32- import { showError , showSuccess } from ' @nextcloud/dialogs'
35+ import { showSuccess } from ' @nextcloud/dialogs'
3336import { generateOcsUrl } from ' @nextcloud/router'
3437
3538import NcButton from ' @nextcloud/vue/components/NcButton'
3639import NcDialog from ' @nextcloud/vue/components/NcDialog'
3740import NcLoadingIcon from ' @nextcloud/vue/components/NcLoadingIcon'
41+ import NcNoteCard from ' @nextcloud/vue/components/NcNoteCard'
3842import NcPasswordField from ' @nextcloud/vue/components/NcPasswordField'
3943
4044import { useSignMethodsStore } from ' ../store/signMethods.js'
41-
4245export default {
4346 name: ' CreatePassword' ,
4447 components: {
4548 NcDialog,
49+ NcNoteCard,
4650 NcPasswordField,
4751 NcButton,
4852 NcLoadingIcon,
@@ -55,11 +59,13 @@ export default {
5559 return {
5660 hasLoading: false ,
5761 password: ' ' ,
62+ errorMessage: ' ' ,
5863 }
5964 },
6065 methods: {
6166 async send () {
6267 this .hasLoading = true
68+ this .errorMessage = ' '
6369 await axios .post (generateOcsUrl (' /apps/libresign/api/v1/account/signature' ), {
6470 signPassword: this .password ,
6571 })
@@ -73,9 +79,9 @@ export default {
7379 .catch (({ response }) => {
7480 this .signMethodsStore .setHasSignatureFile (false )
7581 if (response .data ? .ocs ? .data ? .message ) {
76- showError ( response .data .ocs .data .message )
82+ this . errorMessage = response .data .ocs .data .message
7783 } else {
78- showError ( t (' libresign' , ' Error creating new password, please contact the administrator' ) )
84+ this . errorMessage = t (' libresign' , ' Error creating new password, please contact the administrator' )
7985 }
8086 this .$emit (' password:created' , false )
8187 })
0 commit comments