Fix form password + remove branding
This commit is contained in:
parent
bd5fa87997
commit
07dbc3adf3
|
@ -85,6 +85,7 @@ class FormResource extends JsonResource
|
||||||
'is_password_protected' => true,
|
'is_password_protected' => true,
|
||||||
'has_password' => $this->has_password,
|
'has_password' => $this->has_password,
|
||||||
'width' => 'centered',
|
'width' => 'centered',
|
||||||
|
'no_branding' => $this->no_branding,
|
||||||
'properties' => []
|
'properties' => []
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,15 +75,20 @@ onBeforeRouteLeave((to, from) => {
|
||||||
})
|
})
|
||||||
|
|
||||||
const passwordEntered = function (password) {
|
const passwordEntered = function (password) {
|
||||||
useCookie('password-' + slug, {
|
const cookie = useCookie('password-' + slug, {
|
||||||
maxAge: 60 * 60 * 7,
|
maxAge: 60 * 60 * 7,
|
||||||
sameSite: false,
|
sameSite: false,
|
||||||
secure: true
|
secure: true
|
||||||
}).value = sha256(password)
|
})
|
||||||
loadForm().then(() => {
|
cookie.value = sha256(password)
|
||||||
if (form.value?.is_password_protected) {
|
nextTick(() => {
|
||||||
openCompleteForm.value.addPasswordError('Invalid password.')
|
console.log('cookie value:',cookie.value)
|
||||||
}
|
loadForm().then(() => {
|
||||||
|
if (form.value?.is_password_protected) {
|
||||||
|
openCompleteForm.value.addPasswordError('Invalid password.')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
openCompleteForm.value.submit()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,7 +126,6 @@ const loadForm = async (setup=false) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
loadForm()
|
|
||||||
if (form.value) {
|
if (form.value) {
|
||||||
handleDarkMode(form.value?.dark_mode)
|
handleDarkMode(form.value?.dark_mode)
|
||||||
handleTransparentMode(form.value?.transparent_background)
|
handleTransparentMode(form.value?.transparent_background)
|
||||||
|
|
Loading…
Reference in New Issue