package com.cloudhandson.vpdbackoffice.web;

import com.cloudhandson.vpdbackoffice.config.BackofficeProperties;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class LoginController {

  private final BackofficeProperties properties;

  public LoginController(BackofficeProperties properties) {
    this.properties = properties;
  }

  @GetMapping("/login")
  public String login(Model model) {
    model.addAttribute("rememberMeAvailable", properties.security().rememberMeConfigured());
    model.addAttribute("rememberMeDays", properties.security().rememberMeDays());
    return "login";
  }
}
