diff --git a/ui/src/App.jsx b/ui/src/App.jsx index 615ad7e..9192e82 100644 --- a/ui/src/App.jsx +++ b/ui/src/App.jsx @@ -18,23 +18,25 @@ const NAV = [ export default function App() { const [authed, setAuthed] = useState(false) + const [loginUser, setLoginUser] = useState('') const [sources, setSources] = useState([]) const [source, setSource] = useState(() => localStorage.getItem('selectedSource') || '') const [sidebarOpen, setSidebarOpen] = useState(false) async function handleLogin(user, pass) { setCredentials(user, pass) - // Verify credentials by hitting the API — throws on 401 await api.getSources().then(s => { setSources(s) if (!source && s.length > 0) setSource(s[0].name) setAuthed(true) + setLoginUser(user) }) } function handleLogout() { clearCredentials() setAuthed(false) + setLoginUser('') setSources([]) } @@ -57,12 +59,15 @@ export default function App() { const sidebar = (
{/* Header */} -
- Dataflow -
- +
+
+ Dataflow
+
+ {loginUser} + +
{/* Source selector */}