fix: guard submitStep() against consent bypass via child @submit and forceComplete paths (#19)

* fix: guard submitStep() against consent bypass via child component @submit events

* fix: extend consent guard to cover forceComplete path and disable Complete button

---------

Co-authored-by: mario.pander <developbob50@gmail.com>
pull/639/head
devin-ai-integration[bot] 1 week ago committed by GitHub
parent da120aacaa
commit 76b7f27fcf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -99,7 +99,7 @@
type="submit" type="submit"
name="completed" name="completed"
value="true" value="true"
:disabled="isSubmittingComplete" :disabled="isSubmittingComplete || (requireConsent && !consentAccepted)"
> >
<span class="flex items-center"> <span class="flex items-center">
<IconInnerShadowTop <IconInnerShadowTop
@ -1646,10 +1646,14 @@ export default {
return this.$refs.areas.scrollIntoArea(area) return this.$refs.areas.scrollIntoArea(area)
}, },
async submitStep (e) { async submitStep (e) {
this.isSubmitting = true
const forceComplete = e?.submitter?.getAttribute('name') === 'completed' const forceComplete = e?.submitter?.getAttribute('name') === 'completed'
if (this.requireConsent && !this.consentAccepted && (this.isLastStep || forceComplete)) {
return
}
this.isSubmitting = true
if (forceComplete) { if (forceComplete) {
this.isSubmittingComplete = true this.isSubmittingComplete = true
} }

Loading…
Cancel
Save