login failed (#64)

This commit is contained in:
Michael Quigley 2022-09-20 16:10:21 -04:00
parent 242a8bee7b
commit 073507e0e0
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
2 changed files with 9 additions and 0 deletions

View File

@ -4,6 +4,9 @@ import * as identity from './api/identity';
const Login = (props) => {
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
const [failed, setFailed] = useState();
const errorMessage = <h2 className={"errorMessage"}>Login Failed!</h2>;
const handleSubmit = async e => {
e.preventDefault()
@ -21,6 +24,7 @@ const Login = (props) => {
console.log('login succeeded', resp)
} else {
console.log('login failed')
setFailed(errorMessage);
}
})
.catch((resp) => {
@ -32,6 +36,7 @@ const Login = (props) => {
<div className={"fullscreen"}>
<img src={"ziggy.svg"} width={200}/>
<h1>zrok</h1>
{failed}
<form onSubmit={handleSubmit}>
<fieldset>
<legend>Log In</legend>

View File

@ -134,3 +134,7 @@ h1, h2, h3, h4, h5, h6 {
svg.flowNode {
vertical-align: middle;
}
.errorMessage {
color: deeppink;
}