fix: root route shows Agent page instead of LandingPage

- / now defaults to AgentChatPage (NOFXi's main interface)
- Agent page accessible without login
- LandingPage only shown at /landing or for non-agent pages when not logged in
This commit is contained in:
shinchan-zhai
2026-03-23 09:14:34 +08:00
parent 2c020d3dc7
commit 9264f1af82

View File

@@ -445,13 +445,15 @@ function App() {
</div>
)
}
// Show landing page for root route
if (route === '/' || route === '') {
// Root route → go to Agent (NOFXi 的主界面就是 Agent)
// Landing page only for explicit /landing
if (route === '/landing') {
return <LandingPage />
}
// Redirect unauthenticated users to landing page
if (!user || !token) {
// Agent page is accessible without login
// Other pages redirect to landing if not authenticated
if ((!user || !token) && currentPage !== 'agent') {
return <LandingPage />
}