OnLoginClick Logic
Fetch data from the backend and save the session id to the local storage
This commit is contained in:
@@ -5,17 +5,32 @@ export default function Login() {
|
||||
|
||||
let url = "http://localhost:8080/users"
|
||||
|
||||
function on_login_click()
|
||||
{
|
||||
async function on_login_click() {
|
||||
url += "?mail=" + inputUserName + "&password=" + inputPassword;
|
||||
|
||||
fetch(url, {
|
||||
let response = await fetch(url, {
|
||||
method: "GET",
|
||||
}).then(r => console.log())
|
||||
});
|
||||
|
||||
let reader = response.body.getReader();
|
||||
let value = String.fromCharCode.apply(null, ((await reader.read()).value))
|
||||
if(value != "failed")
|
||||
{
|
||||
localStorage.setItem("sessionid", value)
|
||||
}
|
||||
else
|
||||
{
|
||||
setInputPassword("");
|
||||
setInputUserName("");
|
||||
setHint("wrong login credentials")
|
||||
setBackgroundColor("rgb(171,89,89)")
|
||||
}
|
||||
}
|
||||
|
||||
const [inputUserName, setInputUserName] = useState("")
|
||||
const [inputPassword, setInputPassword] = useState("")
|
||||
const [hint, setHint] = useState("type here")
|
||||
const [backgroundColor, setBackgroundColor] = useState("rgb(255, 255, 255)")
|
||||
|
||||
return (
|
||||
<div className="border">
|
||||
@@ -24,10 +39,16 @@ export default function Login() {
|
||||
<div className={"placement"}>
|
||||
<br/>
|
||||
<p className={"font-kinda-big"}>Username</p>
|
||||
<input type="text" value={inputUserName} onChange={e => setInputUserName(e.target.value)} placeholder="Type here" className="input input-bordered input-sm w-full max-w-xs"/>
|
||||
<input type="text" value={inputUserName} onChange={e => setInputUserName(e.target.value)} placeholder={hint} className="input input-bordered input-sm w-full max-w-xs"
|
||||
style={{
|
||||
backgroundColor: backgroundColor
|
||||
}}/>
|
||||
<br/>
|
||||
<p className={"font-kinda-big"}>Password</p>
|
||||
<input type="password" value={inputPassword} onChange={e => setInputPassword(e.target.value)} placeholder="Type here" className="input input-bordered input-sm w-full max-w-xs"/>
|
||||
<input type="password" value={inputPassword} onChange={e => setInputPassword(e.target.value)} placeholder={hint} className="input input-bordered input-sm w-full max-w-xs"
|
||||
style={{
|
||||
backgroundColor: backgroundColor
|
||||
}}/>
|
||||
</div>
|
||||
<Button text={"Login"} color={"#e2001a"} width={"25px"} onClick={() => on_login_click()}/>
|
||||
</login>
|
||||
|
||||
Binary file not shown.
@@ -1663,3 +1663,249 @@ java.sql.SQLClientInfoException: Client info name 'ApplicationName' not supporte
|
||||
org.h2.jdbc.JdbcSQLSyntaxErrorException: Tabelle "ENTRY" nicht gefunden
|
||||
Table "ENTRY" not found; SQL statement:
|
||||
select * from entry [42102-214]
|
||||
2023-05-16 19:16:09 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:18:22 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:23:49 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:23:49 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:32:50 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:35:45 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:36:14 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:36:16 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:37:38 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:37:47 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:38:37 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:38:45 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:38:45 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:38:46 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:38:46 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:38:46 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:38:46 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:38:46 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:39:02 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:39:02 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:39:03 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:39:03 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:39:03 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:39:03 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:39:03 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:39:03 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:39:05 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:39:05 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:39:05 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:39:06 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:39:06 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:39:07 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:39:07 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:39:07 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:39:07 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:39:07 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:39:08 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:39:08 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:39:08 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:39:20 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:39:20 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:39:20 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:39:20 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:39:20 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:39:21 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:39:21 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:39:21 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:39:21 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:39:21 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:41:15 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:41:21 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:41:23 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:41:24 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:41:53 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:41:53 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:41:53 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:41:54 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:41:54 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:41:54 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:41:56 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:41:57 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:41:57 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:41:57 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:41:58 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:41:58 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:41:58 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:41:58 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:43:13 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:43:48 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:43:54 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:43:55 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:43:56 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:43:56 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:43:56 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:44:05 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:44:18 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:45:42 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:47:26 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:47:56 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:49:01 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:51:18 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
2023-05-16 19:51:44 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||
No data is available [2000-214]
|
||||
|
||||
@@ -63,6 +63,6 @@ public class UserSessionIDHandler
|
||||
return generatedString;
|
||||
}
|
||||
|
||||
return "";
|
||||
return "failed";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user