Update environment configuration and enhance Docker setup for production deployment
- Changed NODE_ENV from development to production in .env.example for production readiness. - Updated WEBUI_URL to point to the new public URL behind Traefik. - Added internal and external networks in docker-compose.yml for improved service isolation and routing. - Removed direct port exposure for the WebUI, ensuring it is only accessible through Traefik. - Refactored landing and login pages in the WebUI to streamline navigation and error handling, redirecting users appropriately based on session status.
This commit is contained in:
40
apps/webui/src/components/auth/login-card.tsx
Normal file
40
apps/webui/src/components/auth/login-card.tsx
Normal file
@@ -0,0 +1,40 @@
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
import { getLocale, t } from '@/lib/i18n';
|
||||
|
||||
const KNOWN_ERRORS = ['access_denied', 'invalid_request', 'invalid_state', 'oauth_failed'] as const;
|
||||
|
||||
export async function LoginCard({ error }: { error?: string }) {
|
||||
const locale = await getLocale();
|
||||
const errorMessage =
|
||||
error && (KNOWN_ERRORS as readonly string[]).includes(error)
|
||||
? t(locale, `login.errors.${error}`)
|
||||
: undefined;
|
||||
|
||||
return (
|
||||
<main className="flex min-h-screen items-center justify-center px-4">
|
||||
<Card className="w-full max-w-sm">
|
||||
<CardHeader className="items-center text-center">
|
||||
<div className="mb-2 flex size-12 items-center justify-center rounded-xl bg-primary text-lg font-semibold text-primary-foreground">
|
||||
N
|
||||
</div>
|
||||
<CardTitle className="text-xl">{t(locale, 'login.title')}</CardTitle>
|
||||
<CardDescription>{t(locale, 'login.subtitle')}</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
{errorMessage && (
|
||||
<p className="rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive">
|
||||
{errorMessage}
|
||||
</p>
|
||||
)}
|
||||
<a
|
||||
href="/api/auth/login"
|
||||
className="inline-flex h-10 w-full items-center justify-center gap-2 rounded-md bg-primary text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90"
|
||||
>
|
||||
{t(locale, 'login.cta')}
|
||||
</a>
|
||||
<p className="text-center text-xs text-muted-foreground">{t(locale, 'login.footer')}</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user