Merge remote-tracking branch 'origin/frontend' into gruppPP
This commit is contained in:
commit
f0fc465d1a
21 changed files with 721 additions and 112 deletions
|
|
@ -29,15 +29,15 @@ const PreloadBackgroundAnimation = (): JSX.Element => {
|
|||
function LoginPage(): JSX.Element {
|
||||
//Example users for testing without backend, remove when using backend
|
||||
const admin: NewUser = {
|
||||
name: "admin",
|
||||
userName: "admin",
|
||||
password: "123",
|
||||
};
|
||||
const pmanager: NewUser = {
|
||||
name: "pmanager",
|
||||
userName: "pmanager",
|
||||
password: "123",
|
||||
};
|
||||
const user: NewUser = {
|
||||
name: "user",
|
||||
userName: "user",
|
||||
password: "123",
|
||||
};
|
||||
|
||||
|
|
@ -48,11 +48,14 @@ function LoginPage(): JSX.Element {
|
|||
function handleSubmit(event: FormEvent<HTMLFormElement>): void {
|
||||
event.preventDefault();
|
||||
//TODO: Compare with db instead when finished
|
||||
if (username === admin.name && password === admin.password) {
|
||||
if (username === admin.userName && password === admin.password) {
|
||||
navigate("/admin-menu");
|
||||
} else if (username === pmanager.name && password === pmanager.password) {
|
||||
} else if (
|
||||
username === pmanager.userName &&
|
||||
password === pmanager.password
|
||||
) {
|
||||
navigate("/PM-project-page");
|
||||
} else if (username === user.name && password === user.password) {
|
||||
} else if (username === user.userName && password === user.password) {
|
||||
navigate("/your-projects");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue