Merge

parent 3c2e8c53
......@@ -51,6 +51,9 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
.authorizeRequests()
.antMatchers("/").authenticated()
.antMatchers("/home").authenticated()
.antMatchers("/cargo*").authenticated()
.antMatchers("/convocatoria*").authenticated()
.antMatchers("/tecnologia*").authenticated()
.antMatchers("/postulantes").authenticated()
.anyRequest().permitAll()
.and()
......
......@@ -3,7 +3,6 @@ package com.roshka.controller;
import com.roshka.modelo.RRHHUser;
import com.roshka.repositorio.RRHHUserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
......@@ -35,7 +34,10 @@ public class RRHHUserController {
}
@GetMapping("/login")
public String getLogin() {
public String getLogin(Model model, HttpServletRequest request) {
if(request.getParameter("error")!=null){
model.addAttribute("error", "Credenciales Incorrectas");
}
return "login";
}
......
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<div class="container">
<c:if test="${not empty error}">
<div class="alert alert-danger alert-dismissible fade show" role="alert">
${error}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
</c:if>
<c:if test="${not empty success}">
<div class="alert alert-success alert-dismissible fade show" role="alert">
${success}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
</c:if>
</div>
\ No newline at end of file
......@@ -15,20 +15,13 @@
<body>
<div class="container">
<jsp:include page="header.jsp"/>
<jsp:include page="alerts.jsp"/>
<a href="postulante">Form postulante</a>
<div>
<form action="/logout" method="get">
<p>
Welcome
</p>
<input type="submit" value="Sign Out" />
</form>
</div>
<a href="postulantes">Lista de postulantes</a>
<a href="#">Tecnologias</a>
<a href="convocatorias">Lista de convocatorias</a>
<a href="cargos">Lista de cargos</a>
</div>
<a href="postulante">Form postulante</a>
<a href="postulantes">Lista de postulantes</a>
<a href="#">Tecnologias</a>
<a href="convocatorias">Lista de convocatorias</a>
<a href="cargos">Lista de cargos</a>
</body>
</html>
\ No newline at end of file
......@@ -6,11 +6,12 @@
<meta name="description" content="">
<meta name="author" content="">
<title>Login</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link href="https://getbootstrap.com/docs/4.0/examples/signin/signin.css" rel="stylesheet" crossorigin="anonymous">
</head>
<body>
<jsp:include page="alerts.jsp"/>
<section class="vh-100" style="background-color: #508bfc;">
<div class="container py-5 h-100">
<div class="row d-flex justify-content-center align-items-center h-100">
......@@ -44,7 +45,7 @@
</div>
</div>
</section>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
</body>
</html>
......@@ -30,7 +30,7 @@
<form:form action="/process_register" class="px-md-2" method="POST" modelAttribute="user">
<div class="form-outline mb-4">
<form:label path="email" class="form-label">Email</form:label>
<form:input path="email" class="form-control" required="required"></form:input>
<form:input path="email" type="email" class="form-control" required="required"></form:input>
</div>
<div class="row">
<div class="col-md-6 mb-4">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment