refactor icons. Somehow button colors are no longer working...
This commit is contained in:
parent
a224397079
commit
3f075d509b
16 changed files with 152 additions and 110 deletions
|
|
@ -1,11 +1,12 @@
|
|||
import { useState } from "react";
|
||||
import Button, { ButtonType } from "./basics/Button";
|
||||
import Button from "./basics/Button";
|
||||
import type { LoginRequestDto } from "../api/dtos/LoginRequestDto";
|
||||
import type { LoginResponseDto } from "../api/dtos/LoginResponseDto";
|
||||
import { login } from "../api/points/AuthPoint";
|
||||
import { getRecipeListUrl } from "../routes";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import PasswordField from "./basics/PasswordField";
|
||||
import { ButtonType } from "./basics/BasicButtonDefinitions";
|
||||
|
||||
export default function LoginPage() {
|
||||
const [userName, setUserName] = useState<string>("");
|
||||
|
|
@ -14,6 +15,9 @@ export default function LoginPage() {
|
|||
|
||||
const navigate = useNavigate();
|
||||
|
||||
/**
|
||||
* Login
|
||||
*/
|
||||
const executeLogin = async () => {
|
||||
const dto: LoginRequestDto = {
|
||||
userName,
|
||||
|
|
@ -26,6 +30,7 @@ export default function LoginPage() {
|
|||
localStorage.setItem("session", JSON.stringify(loginResponse));
|
||||
console.log("Successfully logged in as " + loginResponse.userData?.userName);
|
||||
setErrorMessage(null);
|
||||
// navigate to recipe list after successful login
|
||||
navigate(getRecipeListUrl());
|
||||
} catch (err: any) {
|
||||
console.error("Login failed:", err);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue