Skip to content

Beautiful Open-Source Form Builder

Global custom domainmiddleware client as well

Julien Nahumb25bc8bca838
diff --git a/client/middleware/custom-domain.global.js b/client/middleware/custom-domain.global.js
index d2b43ff02..24d2381de 100644
--- a/client/middleware/custom-domain.global.js
+++ b/client/middleware/custom-domain.global.js
@@ -17,18 +17,14 @@ function redirectToMainDomain() {
}
export default defineNuxtRouteMiddleware((to, from) => {
- if (process.client) return
+ if (!customDomainUsed()) return
const config = useRuntimeConfig()
- if (!customDomainUsed()) return
-
- console.info('loadedConfig',useRuntimeConfig())
- console.log(useRequestHeaders(),customDomainHeaderName)
const customDomainHeaderValue = useRequestHeaders()[customDomainHeaderName]
if (!customDomainHeaderValue || customDomainHeaderValue !== getDomain(getHost())) {
// If custom domain header doesn't match, redirect
- console.info('Custom domain header does not match, redirecting',{
+ console.error('Custom domain header does not match, redirecting',{
'customDomainHeaderValue': customDomainHeaderValue,
'host': getDomain(getHost()),
})