Skip to content

Beautiful Open-Source Form Builder

Fix self-hosted PDF editor and password form issues (#1184)

Julien Nahum8aa37796e59a
diff --git a/client/components/open/pdf-editor/PdfZoneEditor.vue b/client/components/open/pdf-editor/PdfZoneEditor.vue
index 26a76d494..803b0dfc9 100644
--- a/client/components/open/pdf-editor/PdfZoneEditor.vue
+++ b/client/components/open/pdf-editor/PdfZoneEditor.vue
@@ -896,12 +896,12 @@ watch(lastAddedZoneId, async (zoneId) => {
await nextTick()
const pageEl = pageRefs.value[zone.page]
if (pageEl) {
- pageEl.scrollIntoView({ behavior: 'smooth', block: 'center' })
+ pageEl.scrollIntoView({ behavior: 'auto', block: 'start' })
}
await nextTick()
const zoneEl = zoneRefs.value[zoneId]
if (zoneEl) {
- zoneEl.scrollIntoView({ behavior: 'smooth', block: 'center', inline: 'nearest' })
+ zoneEl.scrollIntoView({ behavior: 'auto', block: 'nearest', inline: 'nearest' })
}
pdfStore.clearLastAddedZone()
})
diff --git a/client/pages/forms/[slug]/index.vue b/client/pages/forms/[slug]/index.vue
index f45442a8f..d4e74fff9 100644
--- a/client/pages/forms/[slug]/index.vue
+++ b/client/pages/forms/[slug]/index.vue
@@ -80,10 +80,12 @@ const onFormSubmitted = () => {
}
const passwordEntered = function (password) {
+ const usesHttps = import.meta.client && window.location.protocol === 'https:'
const cookie = useCookie('password-' + slug, {
maxAge: 60 * 60 * 7,
- sameSite: 'none',
- secure: true
+ // Secure cookies are rejected on plain HTTP self-hosted instances.
+ sameSite: usesHttps ? 'none' : 'lax',
+ secure: usesHttps
})
cookie.value = sha256(password)