From 8e35631ec81542ea48d94e22474d32524fd6b7df Mon Sep 17 00:00:00 2001 From: Stavros Date: Sun, 21 Jun 2026 15:49:17 +0300 Subject: [PATCH] chore: remove trusted domains and rely on single app url --- frontend/src/components/layout/layout.tsx | 6 +-- frontend/src/schemas/app-context-schema.ts | 1 - internal/bootstrap/app_bootstrap.go | 9 ++-- internal/controller/context_controller.go | 10 ++-- internal/controller/oauth_controller.go | 60 +++++++++------------- internal/model/runtime.go | 1 - 6 files changed, 34 insertions(+), 53 deletions(-) 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 {