Skip to content

Commit 8e87838

Browse files
fix: request verification codes by sign request UUID
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 7d0a7b0 commit 8e87838

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/views/SignPDF/_partials/ModalVerificationCode.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ import NcIconSvgWrapper from '@nextcloud/vue/components/NcIconSvgWrapper'
157157
158158
import { useSignStore } from '../../../store/sign.js'
159159
import { useSignMethodsStore } from '../../../store/signMethods.js'
160+
import { getCurrentSignerSignRequestUuid } from '../../../utils/signRequestUuid.ts'
160161
import { validateEmail } from '../../../utils/validators.js'
161162
162163
const sanitizePhoneNumber = (val: string) => {
@@ -198,7 +199,7 @@ type SignMethodsStore = {
198199
type SignStore = {
199200
document: {
200201
fileId?: number
201-
signers?: Array<{ me?: boolean; sign_uuid?: string }>
202+
signers?: Array<{ me?: boolean; sign_request_uuid?: string }>
202203
}
203204
errors?: Array<{ message?: string }>
204205
}
@@ -391,10 +392,13 @@ async function requestCode() {
391392
params,
392393
)
393394
} else {
394-
const signer = signStore.document.signers?.find((row) => row.me) || {}
395+
const signRequestUuid = getCurrentSignerSignRequestUuid(signStore.document)
396+
if (!signRequestUuid) {
397+
throw new Error(t('libresign', 'Document not found'))
398+
}
395399
await axios.post(
396400
generateOcsUrl('/apps/libresign/api/v1/sign/uuid/{uuid}/code', {
397-
uuid: signer.sign_uuid,
401+
uuid: signRequestUuid,
398402
}),
399403
params,
400404
)

0 commit comments

Comments
 (0)