Fix the custom domain default redirect

This commit is contained in:
Julien Nahum 2023-11-30 11:31:56 +01:00
parent 0b57ab4cdd
commit 164b8c4ddd
1 changed files with 2 additions and 2 deletions

View File

@ -1,11 +1,11 @@
export default async (to, from, next) => { export default async (to, from, next) => {
if (!window.config.custom_domains) { if (!window.config.custom_domains_enabled) {
next() next()
} }
const isCustomDomain = getDomain(window.location.href) !== getDomain(window.config.app_url) const isCustomDomain = getDomain(window.location.href) !== getDomain(window.config.app_url)
if (isCustomDomain && !['forms.show_public'].includes(to.name)) { if (isCustomDomain && !['forms.show_public'].includes(to.name)) {
// If route isn't a public form, redirect // If route isn't a public form, redirect
window.location.href = 'https://opnform.com/' window.location.href = 'https://opnform.com/?utm_source=failed_custom_domain_redirect'
} else { } else {
next() next()
} }