Debugging custom domain
This commit is contained in:
parent
47c779fd9a
commit
c35c505114
|
@ -77,5 +77,10 @@ export const customDomainUsed = function() {
|
|||
const appDomain = getDomain(config.public.appUrl)
|
||||
const host = getHost()
|
||||
|
||||
console.debug('customDomainUsed', {
|
||||
'appDomain': appDomain,
|
||||
'host': host,
|
||||
'customDomain': host !== appDomain && getDomain(host) !== appDomain
|
||||
})
|
||||
return host !== appDomain && getDomain(host) !== appDomain
|
||||
}
|
||||
|
|
|
@ -26,6 +26,10 @@ export default defineNuxtRouteMiddleware((to, from) => {
|
|||
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',{
|
||||
'customDomainHeaderValue': customDomainHeaderValue,
|
||||
'host': getDomain(getHost()),
|
||||
})
|
||||
return redirectToMainDomain()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue