Merge

parent 3c2e8c53
...@@ -51,6 +51,9 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -51,6 +51,9 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
.authorizeRequests() .authorizeRequests()
.antMatchers("/").authenticated() .antMatchers("/").authenticated()
.antMatchers("/home").authenticated() .antMatchers("/home").authenticated()
.antMatchers("/cargo*").authenticated()
.antMatchers("/convocatoria*").authenticated()
.antMatchers("/tecnologia*").authenticated()
.antMatchers("/postulantes").authenticated() .antMatchers("/postulantes").authenticated()
.anyRequest().permitAll() .anyRequest().permitAll()
.and() .and()
......
...@@ -3,7 +3,6 @@ package com.roshka.controller; ...@@ -3,7 +3,6 @@ package com.roshka.controller;
import com.roshka.modelo.RRHHUser; import com.roshka.modelo.RRHHUser;
import com.roshka.repositorio.RRHHUserRepository; import com.roshka.repositorio.RRHHUserRepository;
import org.springframework.beans.factory.annotation.Autowired; 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.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
...@@ -35,7 +34,10 @@ public class RRHHUserController { ...@@ -35,7 +34,10 @@ public class RRHHUserController {
} }
@GetMapping("/login") @GetMapping("/login")
public String getLogin() { public String getLogin(Model model, HttpServletRequest request) {
if(request.getParameter("error")!=null){
model.addAttribute("error", "Credenciales Incorrectas");
}
return "login"; 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 @@ ...@@ -15,20 +15,13 @@
<body> <body>
<div class="container"> <div class="container">
<jsp:include page="header.jsp"/> <jsp:include page="header.jsp"/>
<jsp:include page="alerts.jsp"/>
<a href="postulante">Form postulante</a> <a href="postulante">Form postulante</a>
<div> <a href="postulantes">Lista de postulantes</a>
<form action="/logout" method="get"> <a href="#">Tecnologias</a>
<p> <a href="convocatorias">Lista de convocatorias</a>
Welcome <a href="cargos">Lista de cargos</a>
</p>
<input type="submit" value="Sign Out" />
</form>
</div>
</div> </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> </body>
</html> </html>
\ No newline at end of file
...@@ -6,11 +6,12 @@ ...@@ -6,11 +6,12 @@
<meta name="description" content=""> <meta name="description" content="">
<meta name="author" content=""> <meta name="author" content="">
<title>Login</title> <title>Login</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" rel="stylesheet" <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
<link href="https://getbootstrap.com/docs/4.0/examples/signin/signin.css" rel="stylesheet" crossorigin="anonymous"> <link href="https://getbootstrap.com/docs/4.0/examples/signin/signin.css" rel="stylesheet" crossorigin="anonymous">
</head> </head>
<body> <body>
<jsp:include page="alerts.jsp"/>
<section class="vh-100" style="background-color: #508bfc;"> <section class="vh-100" style="background-color: #508bfc;">
<div class="container py-5 h-100"> <div class="container py-5 h-100">
<div class="row d-flex justify-content-center align-items-center h-100"> <div class="row d-flex justify-content-center align-items-center h-100">
...@@ -44,7 +45,7 @@ ...@@ -44,7 +45,7 @@
</div> </div>
</div> </div>
</section> </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> </body>
</html> </html>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<form:form action="/process_register" class="px-md-2" method="POST" modelAttribute="user"> <form:form action="/process_register" class="px-md-2" method="POST" modelAttribute="user">
<div class="form-outline mb-4"> <div class="form-outline mb-4">
<form:label path="email" class="form-label">Email</form:label> <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>
<div class="row"> <div class="row">
<div class="col-md-6 mb-4"> <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