diff --git a/server/internal/auth/local.go b/server/internal/auth/local.go index d135167..8b5df21 100644 --- a/server/internal/auth/local.go +++ b/server/internal/auth/local.go @@ -50,11 +50,13 @@ func HandleLocalLogin(c *gin.Context) { func HandleBootstrapStatus(c *gin.Context) { var ( - n int64 - err error + n int64 + err error + orgName string ) if org, ok := OrgFromHost(c); ok { n, err = services.CountOrgUsers(org.OrgID) + orgName = org.Name } else { n, err = services.CountUsers() } @@ -62,7 +64,7 @@ func HandleBootstrapStatus(c *gin.Context) { c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()}) return } - c.JSON(http.StatusOK, gin.H{"needs_setup": n == 0}) + c.JSON(http.StatusOK, gin.H{"needs_setup": n == 0, "org_name": orgName}) } diff --git a/web/app/login/page.tsx b/web/app/login/page.tsx index a26bb81..faf3be8 100644 --- a/web/app/login/page.tsx +++ b/web/app/login/page.tsx @@ -4,14 +4,13 @@ import { useEffect, useState } from "react"; import { useMutation } from "@tanstack/react-query"; import { auth } from "@/lib/api"; import { Button, Card } from "@/components/ui"; +import { Logo } from "@/components/Logo"; export default function LoginPage() { const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); + const [orgName, setOrgName] = useState(""); - - - useEffect(() => { (async () => { try { @@ -20,6 +19,7 @@ export default function LoginPage() { window.location.href = "/setup"; return; } + if (s.org_name) setOrgName(s.org_name); } catch { } @@ -48,12 +48,10 @@ export default function LoginPage() {
-
- - - -
-

Sign in to Vantage

+ +

+ {orgName ? `Sign in to ${orgName}` : "Sign in to Vantage"} +

diff --git a/web/components/Logo.tsx b/web/components/Logo.tsx new file mode 100644 index 0000000..1db8029 --- /dev/null +++ b/web/components/Logo.tsx @@ -0,0 +1,9 @@ +export function Logo({ className }: { className?: string }) { + return ( + + ); +} diff --git a/web/lib/api.ts b/web/lib/api.ts index 0fbbb9f..a2df0e5 100644 --- a/web/lib/api.ts +++ b/web/lib/api.ts @@ -321,6 +321,7 @@ export interface MeResponse { export interface BootstrapStatus { needs_setup: boolean; + org_name?: string; } export interface BootstrapResponse {