fix: lighthouse fixes

This commit is contained in:
Stavros
2026-04-14 13:16:15 +03:00
parent 6f99e7acff
commit 93d6191139
5 changed files with 52 additions and 36 deletions

View File

@@ -9,6 +9,10 @@
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<meta name="apple-mobile-web-app-title" content="Tinyauth" />
<meta name="robots" content="nofollow, noindex" />
<meta
name="description"
content="The tiniest authentication and authorization server you have ever seen."
/>
<link rel="manifest" href="/site.webmanifest" />
<title>Tinyauth</title>
</head>

View File

@@ -21,7 +21,7 @@ export const LanguageSelector = () => {
return (
<Select onValueChange={handleSelect} value={language}>
<SelectTrigger>
<SelectTrigger aria-label="Select language">
<SelectValue placeholder="Select language" />
</SelectTrigger>
<SelectContent>

View File

@@ -23,6 +23,7 @@ import { TooltipProvider } from "@/components/ui/tooltip";
const queryClient = new QueryClient();
createRoot(document.getElementById("root")!).render(
<main>
<StrictMode>
<QueryClientProvider client={queryClient}>
<AppContextProvider>
@@ -57,5 +58,6 @@ createRoot(document.getElementById("root")!).render(
</UserContextProvider>
</AppContextProvider>
</QueryClientProvider>
</StrictMode>,
</StrictMode>
</main>,
);

View File

@@ -52,6 +52,11 @@ export default defineConfig({
changeOrigin: true,
rewrite: (path) => path.replace(/^\/\.well-known/, ""),
},
"/robots.txt": {
target: "http://tinyauth-backend:3000/robots.txt",
changeOrigin: true,
rewrite: (path) => path.replace(/^\/robots.txt/, ""),
},
},
allowedHosts: true,
},

View File

@@ -46,6 +46,11 @@ func (m *UIMiddleware) Middleware() gin.HandlerFunc {
case "api", "resources", ".well-known":
c.Next()
return
case "robots.txt":
c.Writer.Header().Set("Content-Type", "text/plain")
c.Writer.WriteHeader(http.StatusOK)
c.Writer.Write([]byte("User-agent: *\nDisallow: /\n"))
return
default:
_, err := fs.Stat(m.uiFs, path)