|
1 | 1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> |
2 | 2 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> |
3 | 3 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> |
| 4 | +<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %> |
4 | 5 |
|
5 | 6 | <html> |
6 | 7 | <jsp:include page="fragments/headTag.jsp"/> |
7 | 8 | <body> |
8 | | -<nav class="navbar navbar-dark bg-dark py-0"> |
9 | | - <div class="container"> |
10 | | - <div class="navbar-brand"><img src="resources/images/icon-meal.png"> <spring:message code="app.title"/></div> |
11 | | - <form class="form-inline my-2" id="login_form" action="spring_security_check" method="post"> |
12 | | - <input class="form-control mr-1" type="text" placeholder="Email" name="username"> |
13 | | - <input class="form-control mr-1" type="password" placeholder="Password" name="password"> |
14 | | - <button class="btn btn-success" type="submit"> |
15 | | - <span class="fa fa-sign-in"></span> |
16 | | - </button> |
17 | | - </form> |
18 | | - </div> |
19 | | -</nav> |
| 9 | +<jsp:include page="fragments/bodyHeader.jsp"/> |
20 | 10 |
|
21 | 11 | <div class="jumbotron py-0"> |
22 | 12 | <div class="container"> |
|
26 | 16 | <c:if test="${not empty param.message}"> |
27 | 17 | <div class="message"><spring:message code="${param.message}" text=""/></div> |
28 | 18 | </c:if> |
29 | | - <br/> |
30 | | - <p> |
31 | | - <button type="submit" class="btn btn-lg btn-primary" onclick="login('user@yandex.ru', 'password')"> |
32 | | - <spring:message code="app.login"/> User |
33 | | - </button> |
34 | | - <button type="submit" class="btn btn-lg btn-primary" onclick="login('admin@gmail.com', 'admin')"> |
35 | | - <spring:message code="app.login"/> Admin |
36 | | - </button> |
37 | | - </p> |
38 | | - <br/> |
| 19 | + <sec:authorize access="isAnonymous()"> |
| 20 | + <div class="pt-2"> |
| 21 | + <button type="submit" class="btn btn-lg btn-primary mt-2" onclick="login('user@yandex.ru', 'password')"> |
| 22 | + <spring:message code="app.login"/> User |
| 23 | + </button> |
| 24 | + <button type="submit" class="btn btn-lg btn-primary mt-2" onclick="login('admin@gmail.com', 'admin')"> |
| 25 | + <spring:message code="app.login"/> Admin |
| 26 | + </button> |
| 27 | + </div> |
| 28 | + </sec:authorize> |
39 | 29 | <div class="lead py-4"><spring:message code="app.stackTitle"/> <br> |
40 | 30 | <a href="http://projects.spring.io/spring-security/">Spring Security</a>, |
41 | 31 | <a href="https://docs.spring.io/spring/docs/current/spring-framework-reference/html/mvc.html">Spring MVC</a>, |
|
0 commit comments