package samuelb.capripol.Controllers;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

@Controller
public class HomeController {

    @GetMapping("/login")
    public String index(Model model, String error, String logout) {
        if (error != null) {
            model.addAttribute("error", "Username and password is invalid");
        }

        if (logout != null) {
            model.addAttribute("logout", "You have successfully logged out.");
        }
        return "login";
    }

    @RequestMapping("/")
    public String blah(){
        return "MainMenu";
    }

}
