Index: client_app/src/components/login/login.js
===================================================================
--- client_app/src/components/login/login.js	(revision 17abe5eb95d30a27747b54273b41e7dbfc9e3c94)
+++ client_app/src/components/login/login.js	(revision 5f9d25a24d71c717ef13ce6ab805ea22f1c42092)
@@ -1,8 +1,7 @@
 import React from 'react';
-import {useHistory} from 'react-router-dom';
-import {Button, Checkbox, Container, Form} from "semantic-ui-react";
+import { Button, Checkbox, Container, Form } from "semantic-ui-react";
+import { Redirect } from 'react-router-dom';
 
 const Login = (props) => {
-    const history = useHistory();
     const [formData, updateFormData] = React.useState({
         email: "",
@@ -25,46 +24,53 @@
 
         props.onCompleteForm(email,password,type);
-        history.push("/");
+    }
+
+    if(!props.loggedIn){
+        return(
+            <Container>
+                <h1 style={{color: "red"}}>{props.error}</h1>
+                <Form onSubmit={onFormSubmit}>
+                    <Form.Input id="email" name="email" type='text' required fluid label='E-mail' placeholder='Enter e-mail.' onChange={handleCheck} />
+                    <Form.Input id="password" name="password" type='password' required fluid label='Password' placeholder='Enter password.' onChange={handleCheck} />
+                    <Form.Field
+                        control={Checkbox}
+                        radio
+                        label='User'
+                        id="0"
+                        name="type"
+                        value="0"
+                        checked={formData.type === "0"}
+                        onChange={handleCheck}
+                    />
+                    <Form.Field
+                        control={Checkbox}
+                        radio
+                        label='Team'
+                        id="1"
+                        name="type"
+                        value="1"
+                        checked={formData.type === "1"}
+                        onChange={handleCheck}
+                    />
+                    <Form.Field
+                        control={Checkbox}
+                        radio
+                        label='Company'
+                        id="2"
+                        name="type"
+                        value="2"
+                        checked={formData.type === "2"}
+                        onChange={handleCheck}
+                    />
+                    <Form.Field control={Button}>LogIn</Form.Field>
+                </Form>
+            </Container>
+        );
     }
 
     return(
-        <Container>
-            <Form onSubmit={onFormSubmit}>
-                <Form.Input id="email" name="email" type='text' required fluid label='E-mail' placeholder='Enter e-mail.' onChange={handleCheck} />
-                <Form.Input id="password" name="password" type='password' required fluid label='Password' placeholder='Enter password.' onChange={handleCheck} />
-                <Form.Field
-                    control={Checkbox}
-                    radio
-                    label='User'
-                    id="0"
-                    name="type"
-                    value="0"
-                    checked={formData.type === "0"}
-                    onChange={handleCheck}
-                />
-                <Form.Field
-                    control={Checkbox}
-                    radio
-                    label='Team'
-                    id="1"
-                    name="type"
-                    value="1"
-                    checked={formData.type === "1"}
-                    onChange={handleCheck}
-                />
-                <Form.Field
-                    control={Checkbox}
-                    radio
-                    label='Company'
-                    id="2"
-                    name="type"
-                    value="2"
-                    checked={formData.type === "2"}
-                    onChange={handleCheck}
-                />
-                <Form.Field control={Button}>LogIn</Form.Field>
-            </Form>
-        </Container>
+        <Redirect to={"/profile"}/>
     );
+
 }
 
