Index: FullyStocked/src/main/java/com/bazi/fullystocked/Models/Exceptions/InvalidArgumentsException.java
===================================================================
--- FullyStocked/src/main/java/com/bazi/fullystocked/Models/Exceptions/InvalidArgumentsException.java	(revision aad0fb36711348ad05926a8e58d3c2feee9910a7)
+++ FullyStocked/src/main/java/com/bazi/fullystocked/Models/Exceptions/InvalidArgumentsException.java	(revision 3179a2cc9696f22fd1bfbd5f5dfc99f2b603f147)
@@ -4,5 +4,5 @@
 
     public InvalidArgumentsException() {
-        super("Invalid arguments exception");
+        super("Invalid arguments");
     }
 }
Index: FullyStocked/src/main/java/com/bazi/fullystocked/Models/Exceptions/InvalidUserCredentialsException.java
===================================================================
--- FullyStocked/src/main/java/com/bazi/fullystocked/Models/Exceptions/InvalidUserCredentialsException.java	(revision aad0fb36711348ad05926a8e58d3c2feee9910a7)
+++ FullyStocked/src/main/java/com/bazi/fullystocked/Models/Exceptions/InvalidUserCredentialsException.java	(revision 3179a2cc9696f22fd1bfbd5f5dfc99f2b603f147)
@@ -4,5 +4,5 @@
 
     public InvalidUserCredentialsException() {
-        super("Invalid user credentials exception");
+        super("Invalid user credentials");
     }
 }
Index: FullyStocked/src/main/java/com/bazi/fullystocked/Models/Suppliers.java
===================================================================
--- FullyStocked/src/main/java/com/bazi/fullystocked/Models/Suppliers.java	(revision aad0fb36711348ad05926a8e58d3c2feee9910a7)
+++ FullyStocked/src/main/java/com/bazi/fullystocked/Models/Suppliers.java	(revision 3179a2cc9696f22fd1bfbd5f5dfc99f2b603f147)
@@ -35,5 +35,5 @@
     @NotEmpty(message = "Supplier must have street city")
     private String city;
-    @ManyToMany(fetch = FetchType.EAGER)
+    @ManyToMany()
     @JoinTable(name = "supplier_supplies_category",
             joinColumns = @JoinColumn(name = "userid"),
Index: FullyStocked/src/main/java/com/bazi/fullystocked/Services/Implementations/SuppliersServiceImpl.java
===================================================================
--- FullyStocked/src/main/java/com/bazi/fullystocked/Services/Implementations/SuppliersServiceImpl.java	(revision aad0fb36711348ad05926a8e58d3c2feee9910a7)
+++ FullyStocked/src/main/java/com/bazi/fullystocked/Services/Implementations/SuppliersServiceImpl.java	(revision 3179a2cc9696f22fd1bfbd5f5dfc99f2b603f147)
@@ -1,6 +1,9 @@
 package com.bazi.fullystocked.Services.Implementations;
 
+import com.bazi.fullystocked.Models.Categories;
+import com.bazi.fullystocked.Models.Exceptions.InvalidArgumentsException;
 import com.bazi.fullystocked.Models.SqlViews.SuppliersReport;
 import com.bazi.fullystocked.Models.Suppliers;
+import com.bazi.fullystocked.Repositories.CategoriesRepository;
 import com.bazi.fullystocked.Repositories.SuppliersReportRepository;
 import com.bazi.fullystocked.Repositories.SuppliersRepository;
@@ -8,4 +11,5 @@
 import org.springframework.stereotype.Service;
 
+import javax.transaction.Transactional;
 import java.util.List;
 import java.util.Optional;
@@ -40,3 +44,10 @@
         return suppliersRepository.findById(id);
     }
+
+    @Override
+    @Transactional
+    public List<Categories> findCategoriesBySupplier(Integer id) {
+        Suppliers supplier=suppliersRepository.findById(id).orElseThrow(InvalidArgumentsException::new);
+        return supplier.getCategoryList();
+    }
 }
Index: FullyStocked/src/main/java/com/bazi/fullystocked/Services/SuppliersService.java
===================================================================
--- FullyStocked/src/main/java/com/bazi/fullystocked/Services/SuppliersService.java	(revision aad0fb36711348ad05926a8e58d3c2feee9910a7)
+++ FullyStocked/src/main/java/com/bazi/fullystocked/Services/SuppliersService.java	(revision 3179a2cc9696f22fd1bfbd5f5dfc99f2b603f147)
@@ -1,4 +1,5 @@
 package com.bazi.fullystocked.Services;
 
+import com.bazi.fullystocked.Models.Categories;
 import com.bazi.fullystocked.Models.SqlViews.SuppliersReport;
 import com.bazi.fullystocked.Models.Suppliers;
@@ -11,3 +12,4 @@
     List<SuppliersReport> findAllSuppliersReport();
     Optional<Suppliers> findById(Integer id);
+    List<Categories> findCategoriesBySupplier(Integer id);
 }
Index: FullyStocked/src/main/java/com/bazi/fullystocked/Web/Controller/LoginController.java
===================================================================
--- FullyStocked/src/main/java/com/bazi/fullystocked/Web/Controller/LoginController.java	(revision aad0fb36711348ad05926a8e58d3c2feee9910a7)
+++ FullyStocked/src/main/java/com/bazi/fullystocked/Web/Controller/LoginController.java	(revision 3179a2cc9696f22fd1bfbd5f5dfc99f2b603f147)
@@ -13,4 +13,5 @@
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 
 import javax.servlet.http.HttpServletRequest;
@@ -28,7 +29,7 @@
 
     @GetMapping
-    public String getLoginPage(Model m) {
+    public String getLoginPage(Model m, @RequestParam(required = false) String error) {
         m.addAttribute("bodycontent","login");
-
+        m.addAttribute("error", error);
         return "/login";
     }
@@ -61,9 +62,7 @@
             return "redirect:/home";
         }
-        catch (InvalidUserCredentialsException exception) {
-            model.addAttribute("hasError", true);
-            model.addAttribute("error", exception.getMessage());
+        catch (Exception exception) {
 
-            return "redirect:/login";
+            return "redirect:/login?error="+exception.getMessage();
         }
     }
Index: FullyStocked/src/main/java/com/bazi/fullystocked/Web/Controller/RegisterController.java
===================================================================
--- FullyStocked/src/main/java/com/bazi/fullystocked/Web/Controller/RegisterController.java	(revision aad0fb36711348ad05926a8e58d3c2feee9910a7)
+++ FullyStocked/src/main/java/com/bazi/fullystocked/Web/Controller/RegisterController.java	(revision 3179a2cc9696f22fd1bfbd5f5dfc99f2b603f147)
@@ -25,4 +25,5 @@
     public String getRegisterPage(@RequestParam(required = false) String error, Model model)
     {
+        model.addAttribute("error", error);
         return "register";
     }
@@ -46,5 +47,5 @@
             return "redirect:/login";
         }
-        catch (UsernameAlreadyExistsException | InvalidArgumentsException exception)
+        catch (Exception exception)
         {
             return "redirect:/register?error="+exception.getMessage();
@@ -69,6 +70,7 @@
             return "redirect:/login";
         }
-        catch (UsernameAlreadyExistsException | InvalidArgumentsException exception)
+        catch (Exception exception)
         {
+            request.getSession().invalidate();
             return "redirect:/register?error="+exception.getMessage();
         }
Index: FullyStocked/src/main/java/com/bazi/fullystocked/Web/Controller/SupplierController.java
===================================================================
--- FullyStocked/src/main/java/com/bazi/fullystocked/Web/Controller/SupplierController.java	(revision aad0fb36711348ad05926a8e58d3c2feee9910a7)
+++ FullyStocked/src/main/java/com/bazi/fullystocked/Web/Controller/SupplierController.java	(revision 3179a2cc9696f22fd1bfbd5f5dfc99f2b603f147)
@@ -1,6 +1,6 @@
 package com.bazi.fullystocked.Web.Controller;
 
-import com.bazi.fullystocked.Models.Categories;
 import com.bazi.fullystocked.Models.Suppliers;
+import com.bazi.fullystocked.Services.SuppliersService;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
@@ -9,9 +9,14 @@
 
 import javax.servlet.http.HttpServletRequest;
-import java.util.List;
 
 @Controller
 @RequestMapping(value ="/supplier")
 public class SupplierController {
+    private final SuppliersService suppliersService;
+
+    public SupplierController(SuppliersService suppliersService) {
+        this.suppliersService = suppliersService;
+    }
+
     @GetMapping
     public String getSupplierPage()
@@ -24,6 +29,5 @@
     {
         Suppliers s= (Suppliers) request.getSession().getAttribute("user");
-        List<Categories> categoriesList=s.getCategoryList();
-        m.addAttribute("categoires",categoriesList);
+        m.addAttribute("categoires",suppliersService.findCategoriesBySupplier(s.getUserid()));
         return "supplierCategories";
     }
Index: FullyStocked/src/main/resources/templates/login.html
===================================================================
--- FullyStocked/src/main/resources/templates/login.html	(revision aad0fb36711348ad05926a8e58d3c2feee9910a7)
+++ FullyStocked/src/main/resources/templates/login.html	(revision 3179a2cc9696f22fd1bfbd5f5dfc99f2b603f147)
@@ -25,4 +25,7 @@
                     <button type="submit" class="btn btn-primary btn-lg btn-block">Најави се</button>
 
+                    <div class="form-outline mt-3 text-danger" th:if="${error!=null}">
+                        <th:block th:text="${error}"></th:block>
+                    </div>
 
 
Index: FullyStocked/src/main/resources/templates/register.html
===================================================================
--- FullyStocked/src/main/resources/templates/register.html	(revision aad0fb36711348ad05926a8e58d3c2feee9910a7)
+++ FullyStocked/src/main/resources/templates/register.html	(revision 3179a2cc9696f22fd1bfbd5f5dfc99f2b603f147)
@@ -14,4 +14,8 @@
 
                 <p class="text-center h1 fw-bold mb-5 mx-1 mx-md-4 mt-4">Регистрација</p>
+
+                <div class="d-flex justify-content-center mx-4 mb-3 mb-lg-4 text-danger" th:if="${error!=null}">
+                  <th:block th:text="${error}">
+                </div>
 
                 <form class="mx-1 mx-md-4" method="POST" action="/register">
@@ -70,4 +74,5 @@
                   </div>
 
+
                 </form>
                 <p class="d-flex justify-content-center">Веќе имаш профил? <a href="/login" class="link-info"> Најави сe тука!</a></p>
