diff --git a/frontend/src/components/layout/layout.tsx b/frontend/src/components/layout/layout.tsx index e129092e..f9a01d88 100644 --- a/frontend/src/components/layout/layout.tsx +++ b/frontend/src/components/layout/layout.tsx @@ -40,11 +40,7 @@ export const Layout = () => { setIgnoreDomainWarning(true); }, [setIgnoreDomainWarning]); - if ( - !ignoreDomainWarning && - ui.warningsEnabled && - !app.trustedDomains.includes(currentUrl) - ) { + if (!ignoreDomainWarning && ui.warningsEnabled && currentUrl !== app.appUrl) { return ( example.com or - // tinyauth.sub.example.com -> sub.example.com) - _, root, ok := strings.Cut(tu.Host, ".") - if !ok { - continue - } + if u.Host == au.Host { + return true + } - root = strings.ToLower(root) + if !controller.config.Auth.SubdomainsEnabled { + return false + } - // check if the root domain is in the psl - _, err = publicsuffix.DomainFromListWithOptions(publicsuffix.DefaultList, root, nil) - - if err != nil { - continue - } - - // subdomain match - if strings.HasSuffix(strings.ToLower(u.Host), "."+root) { - return true - } + if strings.HasSuffix(u.Host, "."+au.Host) { + return true } return false diff --git a/internal/model/runtime.go b/internal/model/runtime.go index 0df99901..e1c034d3 100644 --- a/internal/model/runtime.go +++ b/internal/model/runtime.go @@ -12,7 +12,6 @@ type RuntimeConfig struct { OAuthProviders map[string]OAuthServiceConfig OAuthWhitelist []string ConfiguredProviders []Provider - TrustedDomains []string } type Provider struct {