Index: Prototype Application/Paw5/src/main/java/finki/paw5/model/exceptions/NonExistingArgumentsException.java
===================================================================
--- Prototype Application/Paw5/src/main/java/finki/paw5/model/exceptions/NonExistingArgumentsException.java	(revision f0232fb99a3ac7792c71956fb500c0a49afd9ea6)
+++ Prototype Application/Paw5/src/main/java/finki/paw5/model/exceptions/NonExistingArgumentsException.java	(revision f0232fb99a3ac7792c71956fb500c0a49afd9ea6)
@@ -0,0 +1,7 @@
+package finki.paw5.model.exceptions;
+
+public class NonExistingArgumentsException extends Exception{
+    public NonExistingArgumentsException() {
+        super("There are empty fields for arguments");
+    }
+}
Index: Prototype Application/Paw5/src/main/java/finki/paw5/repository/UserRepository.java
===================================================================
--- Prototype Application/Paw5/src/main/java/finki/paw5/repository/UserRepository.java	(revision af3f18f33fde0391b554e25476554df0ded3ec2a)
+++ Prototype Application/Paw5/src/main/java/finki/paw5/repository/UserRepository.java	(revision f0232fb99a3ac7792c71956fb500c0a49afd9ea6)
@@ -5,5 +5,8 @@
 import org.springframework.stereotype.Repository;
 
+
 @Repository
 public interface UserRepository extends JpaRepository<User, Integer> {
+        User findByEmailAndPassword(String email, String password);
+        User findByEmail(String email);
 }
Index: Prototype Application/Paw5/src/main/java/finki/paw5/service/AuthService.java
===================================================================
--- Prototype Application/Paw5/src/main/java/finki/paw5/service/AuthService.java	(revision f0232fb99a3ac7792c71956fb500c0a49afd9ea6)
+++ Prototype Application/Paw5/src/main/java/finki/paw5/service/AuthService.java	(revision f0232fb99a3ac7792c71956fb500c0a49afd9ea6)
@@ -0,0 +1,14 @@
+package finki.paw5.service;
+
+import finki.paw5.model.entities.Adopter;
+import finki.paw5.model.entities.Employee;
+import finki.paw5.model.entities.User;
+
+import java.util.Optional;
+
+public interface AuthService {
+    User login (String email, String password);
+//    Adopter registerAdopter(String password, String repeatPassword, String name, String email, String telephone);
+//    Employee registerEmployee(String password, String repeatPassword, String name, String email, String telephone);
+
+}
Index: Prototype Application/Paw5/src/main/java/finki/paw5/service/implementation/AuthServiceImpl.java
===================================================================
--- Prototype Application/Paw5/src/main/java/finki/paw5/service/implementation/AuthServiceImpl.java	(revision f0232fb99a3ac7792c71956fb500c0a49afd9ea6)
+++ Prototype Application/Paw5/src/main/java/finki/paw5/service/implementation/AuthServiceImpl.java	(revision f0232fb99a3ac7792c71956fb500c0a49afd9ea6)
@@ -0,0 +1,47 @@
+package finki.paw5.service.implementation;
+
+import finki.paw5.model.entities.User;
+import finki.paw5.model.exceptions.NonExistingArgumentsException;
+import finki.paw5.repository.UserRepository;
+import finki.paw5.service.AuthService;
+import org.springframework.stereotype.Service;
+
+import java.time.LocalDate;
+import java.util.Objects;
+import java.util.Optional;
+
+@Service
+public class AuthServiceImpl implements AuthService {
+
+    private final UserRepository userRepository;
+
+    public AuthServiceImpl(UserRepository userRepository) {
+        this.userRepository = userRepository;
+    }
+
+    @Override
+    public User login(String email, String password) {
+
+        if(userRepository.findByEmailAndPassword(email, password)!=null){
+            return userRepository.findByEmailAndPassword(email,password);
+        }
+        return null;
+    }
+
+    /*
+    @Override
+    public Adopter registerAdopter(String password, String repeatPassword, String name, String email, String telephone) {
+        if (email == null || email.isEmpty() || password == null || password.isEmpty()) {
+            //throw new Exception();
+        }
+        if (!password.equals(repeatPassword)) {
+            //throw new Exception();
+        }
+        if (this.userRepository.findByEmail(email)!=null) {
+            //throw new Exception("Username exists:"+email);
+        }
+        User user = new User(LocalDate.now(), name, email, password, telephone);
+        return userRepository.save(user);
+    }
+    */
+}
Index: Prototype Application/Paw5/src/main/java/finki/paw5/web/controllers/HomeController.java
===================================================================
--- Prototype Application/Paw5/src/main/java/finki/paw5/web/controllers/HomeController.java	(revision f0232fb99a3ac7792c71956fb500c0a49afd9ea6)
+++ Prototype Application/Paw5/src/main/java/finki/paw5/web/controllers/HomeController.java	(revision f0232fb99a3ac7792c71956fb500c0a49afd9ea6)
@@ -0,0 +1,19 @@
+package finki.paw5.web.controllers;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@Controller
+@RequestMapping("/home")
+public class HomeController {
+
+    @GetMapping
+    public String getHomePage(){
+        return "home";
+    }
+    @GetMapping("/aboutUs")
+    public String getSuccessPage(){
+        return "/aboutUs";
+    }
+}
Index: Prototype Application/Paw5/src/main/java/finki/paw5/web/controllers/LoginController.java
===================================================================
--- Prototype Application/Paw5/src/main/java/finki/paw5/web/controllers/LoginController.java	(revision f0232fb99a3ac7792c71956fb500c0a49afd9ea6)
+++ Prototype Application/Paw5/src/main/java/finki/paw5/web/controllers/LoginController.java	(revision f0232fb99a3ac7792c71956fb500c0a49afd9ea6)
@@ -0,0 +1,49 @@
+package finki.paw5.web.controllers;
+
+import finki.paw5.model.entities.User;
+import finki.paw5.model.exceptions.NonExistingArgumentsException;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import finki.paw5.service.AuthService;
+import jakarta.servlet.http.HttpServletRequest;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.util.Objects;
+
+@Controller
+@RequestMapping("/login")
+public class LoginController {
+
+    private final AuthService authService;
+
+    public LoginController(AuthService authService) {
+        this.authService = authService;
+    }
+
+    @GetMapping
+    public String register(){
+        return "/login";
+    }
+    @PostMapping
+    public String register(@RequestParam String email,  @RequestParam String password, HttpServletRequest request, Model model) throws NonExistingArgumentsException {
+
+        if(email==null || email.equals("") || Objects.equals(password, "") || password==null){
+            throw new NonExistingArgumentsException();
+        }
+        User user = authService.login(email,password);
+
+        if(user!=null){
+            request.getSession().setAttribute("user",user); //go smestuvam korisnikot vo sesija
+            return "redirect:/home";
+        }
+        else{
+            return "redirect:/login";
+        }
+
+
+    }
+}
