Index: src/main/java/com/example/moviezone/model/Customer.java
===================================================================
--- src/main/java/com/example/moviezone/model/Customer.java	(revision 0fb69cc1111c89881e943ce68117a2d3bf39db03)
+++ src/main/java/com/example/moviezone/model/Customer.java	(revision d7f5da99b9515cdc6dea30bb2c4baa9c5e46f490)
@@ -34,4 +34,17 @@
 
     @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+        Customer customer = (Customer) o;
+        return id_user!=null && Objects.equals(id_user,customer.id_user);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash();
+    }
+
+    @Override
     public Collection<? extends GrantedAuthority> getAuthorities() {
         return Collections.singletonList(Role.ROLE_USER);
Index: src/main/java/com/example/moviezone/model/Worker.java
===================================================================
--- src/main/java/com/example/moviezone/model/Worker.java	(revision 0fb69cc1111c89881e943ce68117a2d3bf39db03)
+++ src/main/java/com/example/moviezone/model/Worker.java	(revision d7f5da99b9515cdc6dea30bb2c4baa9c5e46f490)
@@ -10,4 +10,5 @@
 import java.util.Collection;
 import java.util.Collections;
+import java.util.Objects;
 
 @Entity
@@ -32,4 +33,17 @@
     }
 
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+        Worker worker = (Worker) o;
+        return id_user!=null && Objects.equals(id_user, worker.id_user);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash();
+    }
+
     public Worker() {
 
Index: src/main/java/com/example/moviezone/service/Impl/UserServiceImpl.java
===================================================================
--- src/main/java/com/example/moviezone/service/Impl/UserServiceImpl.java	(revision 0fb69cc1111c89881e943ce68117a2d3bf39db03)
+++ src/main/java/com/example/moviezone/service/Impl/UserServiceImpl.java	(revision d7f5da99b9515cdc6dea30bb2c4baa9c5e46f490)
@@ -48,21 +48,21 @@
 
     @Override
-    public User register(String first_name, String last_name, String username, String email, String number, String password,String repeatedPassword, Role role) {
-       if(!password.equals(repeatedPassword))
-           throw new PasswordsDoNotMatchException();
-       if (username==null || username.isEmpty()  || password==null || password.isEmpty())
-            throw new InvalidUsernameOrPasswordException();
+    public void register(String first_name, String last_name, String username, String email, String number, String password, Role role) {
+//       if(!password.equals(repeatedPassword))
+//           throw new PasswordsDoNotMatchException();
+//       if (username==null || username.isEmpty()  || password==null || password.isEmpty())
+//            throw new InvalidUsernameOrPasswordException();
 
        if(role.equals(Role.ROLE_ADMIN))
         {
-            User user= new User(passwordEncoder.encode(password),first_name,last_name,username,email,number);
-            workerRepository.save((Worker) user);
-            return userRepository.save(user);
+//            User user= new User(passwordEncoder.encode(password),first_name,last_name,username,email,number);
+//            workerRepository.save((Worker) user);
+            userRepository.save(new Worker(password,first_name,last_name,email,number,username));
         }
         else
        {
-           Customer customer=new Customer(passwordEncoder.encode(password),first_name,last_name,username,email,number);
-          customerRepository.save(customer);
-           return userRepository.save(customer);
+//           Customer customer=new Customer(passwordEncoder.encode(password),first_name,last_name,username,email,number);
+//           customerRepository.save(customer);
+           userRepository.save(new Customer(password,first_name,last_name,email,number,username));
 
        }
Index: src/main/java/com/example/moviezone/service/UserService.java
===================================================================
--- src/main/java/com/example/moviezone/service/UserService.java	(revision 0fb69cc1111c89881e943ce68117a2d3bf39db03)
+++ src/main/java/com/example/moviezone/service/UserService.java	(revision d7f5da99b9515cdc6dea30bb2c4baa9c5e46f490)
@@ -11,5 +11,5 @@
     User findByUsername(String username);
 
-  User register(String first_name, String last_name,String username, String email, String number, String password,String repeatedPassword, Role role);
+    void register(String first_name, String last_name,String username, String email, String number, String password, Role role);
     User login(String username,String password);
 }
Index: src/main/java/com/example/moviezone/web/HomeController.java
===================================================================
--- src/main/java/com/example/moviezone/web/HomeController.java	(revision 0fb69cc1111c89881e943ce68117a2d3bf39db03)
+++ src/main/java/com/example/moviezone/web/HomeController.java	(revision d7f5da99b9515cdc6dea30bb2c4baa9c5e46f490)
@@ -77,19 +77,21 @@
 
     @PostMapping("/login")
-    public String login(@RequestParam String username,@RequestParam String password,Model model, HttpSession session)
-    {
-        User user = null;
-        try {
-            user=userService.login(username,password);
-            session.setAttribute("sessionUser",user);
-            model.addAttribute("user",user);
+    public String login(@RequestParam String username,
+                        @RequestParam String password,Model model, HttpSession session)
+    {
+//        User user = null;
+//        try {
+           User user=userService.login(username,password);
+        System.out.println(user.getFirst_name());
+//            session.setAttribute("sessionUser",user);
+//            model.addAttribute("user",user);
             return "redirect:/home";
-
-        }catch (UserNotFoundException e)
-        {
-            model.addAttribute("hasError", true);
-            model.addAttribute("error", e.getMessage());
-            return "login";
-        }
+//
+//        }catch (UserNotFoundException e)
+//        {
+//            model.addAttribute("hasError", true);
+//            model.addAttribute("error", e.getMessage());
+//            return "login";
+//        }
 
     }
@@ -106,5 +108,5 @@
     {
         try {
-           User user=userService.register(first_name,last_name,username,email,number,password,repeatedPassword,role);
+           userService.register(first_name,last_name,username,email,number,password,role);
             return "redirect:/login";
         }catch (PasswordsDoNotMatchException exception)
