package application.core.service;

import application.core.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by clapalucian on 12/7/16.
 */
@Service
@Transactional
public class LoginService {

    @Autowired
    private UserRepository userRepo;

    public boolean isLoggedIn(String username, String password) {



        return true;
    }

}

@@ -28,16 +28,52 @@
 rvice;%0A%0A
+import application.core.model.User;%0A
 import a
@@ -466,17 +466,12 @@
 ean 
-isLoggedI
+logi
 n(St
@@ -509,36 +509,268 @@
  %7B%0A%0A
-%0A%0A        return true;%0A    %7D%0A%0A%7D
+        List%3CUser%3E users = userRepo.findAll();%0A%0A        for (User user : users) %7B%0A            if (user.getUsername().equals(username) && user.getPassword().equals(password)) %7B%0A                return true;%0A            %7D%0A        %7D%0A%0A        return false;%0A    %7D%0A%0A%0A%7D%0A%0A
 %0A

add login service