feat: make staff.aethex.tech work as staff section alias
- Add StaffSubdomainRedirect component: when accessed via staff.aethex.tech, auto-redirects to /staff prefix so the subdomain serves the right content - nginx config updated to proxy to aethex-forge (port 5050) instead of dead port 5054 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
fbc5ed2f40
commit
29a32da48a
1 changed files with 13 additions and 0 deletions
|
|
@ -161,6 +161,17 @@ import DeveloperPlatform from "./pages/dev-platform/DeveloperPlatform";
|
|||
|
||||
const queryClient = new QueryClient();
|
||||
|
||||
// When the app is accessed via staff.aethex.tech, auto-redirect to /staff
|
||||
// so the subdomain works as a proper alias for the staff section.
|
||||
const StaffSubdomainRedirect = ({ children }: { children: React.ReactNode }) => {
|
||||
const hostname = typeof window !== "undefined" ? window.location.hostname : "";
|
||||
if (hostname === "staff.aethex.tech" && !window.location.pathname.startsWith("/staff")) {
|
||||
window.location.replace("/staff" + window.location.pathname + window.location.search);
|
||||
return null;
|
||||
}
|
||||
return <>{children}</>;
|
||||
};
|
||||
|
||||
const DiscordActivityWrapper = ({ children }: { children: React.ReactNode }) => {
|
||||
const { isActivity } = useDiscordActivity();
|
||||
|
||||
|
|
@ -181,6 +192,7 @@ const App = () => (
|
|||
<Toaster />
|
||||
<Analytics />
|
||||
<BrowserRouter>
|
||||
<StaffSubdomainRedirect>
|
||||
<DiscordActivityWrapper>
|
||||
<SubdomainPassportProvider>
|
||||
<ArmThemeProvider>
|
||||
|
|
@ -655,6 +667,7 @@ const App = () => (
|
|||
</ArmThemeProvider>
|
||||
</SubdomainPassportProvider>
|
||||
</DiscordActivityWrapper>
|
||||
</StaffSubdomainRedirect>
|
||||
</BrowserRouter>
|
||||
</TooltipProvider>
|
||||
</DiscordProvider>
|
||||
|
|
|
|||
Loading…
Reference in a new issue