diff --git a/webui/src/lib/components/navbar.jsx b/webui/src/lib/components/navbar.jsx index 7421facbae5..e67643742df 100644 --- a/webui/src/lib/components/navbar.jsx +++ b/webui/src/lib/components/navbar.jsx @@ -64,39 +64,31 @@ const TopNavLink = ({ href, children }) => { }; const TopNav = ({logged = true}) => { - if (!logged) { + if (logged) { return ( - - - - lakeFS - - + + + + lakeFS + + + + + + + + + + ); } - return ( - - - - lakeFS - - - - - - - - - - - - ); + return null; }; export default TopNav; diff --git a/webui/src/pages/auth/login.tsx b/webui/src/pages/auth/login.tsx index 3e1a574672c..f15e3e153aa 100644 --- a/webui/src/pages/auth/login.tsx +++ b/webui/src/pages/auth/login.tsx @@ -1,8 +1,6 @@ import React, {useState} from "react"; -import Row from "react-bootstrap/Row"; import Card from "react-bootstrap/Card"; import Form from "react-bootstrap/Form"; -import Col from "react-bootstrap/Col"; import Button from "react-bootstrap/Button"; import {auth, AuthenticationError, setup, SETUP_STATE_INITIALIZED} from "../../lib/api"; import {AlertError, Loading} from "../../lib/components/controls" @@ -32,77 +30,88 @@ export interface LoginConfig { const LoginForm = ({loginConfig}: {loginConfig: LoginConfig}) => { const router = useRouter(); const navigate = useNavigate(); - const [loginError, setLoginError] = useState(null); + const [loginError, setLoginError] = useState(null); const { next } = router.query; const usernamePlaceholder = loginConfig.username_ui_placeholder || "Access Key ID"; const passwordPlaceholder = loginConfig.password_ui_placeholder || "Secret Access Key"; + return ( - - - - -

Login

-
- -
{ - e.preventDefault() - try { - setLoginError(null); - await auth.login(e.target.username.value, e.target.password.value) - router.push(next || '/'); - navigate(0); - } catch(err) { - if (err instanceof AuthenticationError && err.status === 401) { - const contents = {__html: `${loginConfig.login_failed_message}` || +
+ + +
+ lakeFS +
+
+ + { + e.preventDefault() + const form = e.target as HTMLFormElement; + const formData = new FormData(form); + try { + setLoginError(null); + const username = formData.get('username'); + const password = formData.get('password'); + if (typeof username === 'string' && typeof password === 'string') { + await auth.login(username, password); + } + router.push(next || '/'); + navigate(0); + } catch(err) { + if (err instanceof AuthenticationError && err.status === 401) { + const contents = {__html: `${loginConfig.login_failed_message}` || "Credentials don't match."}; - setLoginError(); - } + setLoginError(); } - }}> - - - + } + }}> + + + - - - + + + - {(!!loginError) && } + {(!!loginError) && } - - -
- { loginConfig.fallback_login_url ? - - : "" - } -
-
-
- - + + +
+ { loginConfig.fallback_login_url ? + + : "" + } +
+ + +
) } @@ -151,4 +160,4 @@ const LoginPage = () => { ); }; -export default LoginPage; +export default LoginPage; \ No newline at end of file diff --git a/webui/src/styles/auth.css b/webui/src/styles/auth.css index c27090fdf55..320ef1e2db4 100644 --- a/webui/src/styles/auth.css +++ b/webui/src/styles/auth.css @@ -92,3 +92,15 @@ body .auth-page .nav-pills .nav-link:hover { .auth-page .nav-pills .nav-link.active { background-color: var(--success) !important; } + +.login-card { + max-width: 600px; + width: 90%; + margin: 50px auto auto auto; +} + +.login-logo { + width: 359px; + height: 82px; + filter: brightness(0) saturate(100%); +} \ No newline at end of file