Skip to content

Commit 043acf1

Browse files
committed
Reuse error handling
Issue gh-1189
1 parent 4698aec commit 043acf1

File tree

3 files changed

+15
-25
lines changed

3 files changed

+15
-25
lines changed

Diff for: samples/featured-authorizationserver/src/main/java/sample/web/DeviceErrorController.java renamed to samples/featured-authorizationserver/src/main/java/sample/web/DefaultErrorController.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
* @since 1.1
3131
*/
3232
@Controller
33-
public class DeviceErrorController implements ErrorController {
33+
public class DefaultErrorController implements ErrorController {
3434

3535
@RequestMapping("/error")
3636
public ModelAndView handleError(HttpServletRequest request) {

Diff for: samples/featured-authorizationserver/src/main/resources/templates/access-denied.html

+7-12
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,18 @@
33
<head>
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
6-
<title>Device Grant Example</title>
6+
<title>Spring Security Example</title>
77
<link rel="stylesheet" href="/webjars/bootstrap/css/bootstrap.css" th:href="@{/webjars/bootstrap/css/bootstrap.css}" />
88
<link rel="stylesheet" href="/assets/css/style.css" th:href="@{/assets/css/style.css}" />
99
</head>
1010
<body>
11-
<div class="jumbotron">
12-
<div class="container">
13-
<div class="row">
14-
<div class="col-md-8">
15-
<h2>Access Denied</h2>
16-
<p>You have denied access. Please return to your device to continue.</p>
17-
</div>
18-
<div class="col-md-4">
19-
<img src="https://cdn.pixabay.com/photo/2017/07/03/15/20/technology-2468063_1280.png" class="img-responsive" alt="Devices">
20-
</div>
11+
<div class="container">
12+
<div class="row">
13+
<div class="col-md-8">
14+
<h2>Access Denied</h2>
15+
<p>You have denied access.</p>
2116
</div>
2217
</div>
2318
</div>
2419
</body>
25-
</html>
20+
</html>

Diff for: samples/featured-authorizationserver/src/main/resources/templates/error.html

+7-12
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,18 @@
33
<head>
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
6-
<title>Device Grant Example</title>
6+
<title>Spring Security Example</title>
77
<link rel="stylesheet" href="/webjars/bootstrap/css/bootstrap.css" th:href="@{/webjars/bootstrap/css/bootstrap.css}" />
88
<link rel="stylesheet" href="/assets/css/style.css" th:href="@{/assets/css/style.css}" />
99
</head>
1010
<body>
11-
<div class="jumbotron">
12-
<div class="container">
13-
<div class="row">
14-
<div class="col-md-8">
15-
<h2>Error</h2>
16-
<p th:text="${message}"></p>
17-
</div>
18-
<div class="col-md-4">
19-
<img src="https://cdn.pixabay.com/photo/2017/07/03/15/20/technology-2468063_1280.png" class="img-responsive" alt="Devices">
20-
</div>
11+
<div class="container">
12+
<div class="row">
13+
<div class="col-md-8">
14+
<h2>Error</h2>
15+
<p th:text="${message}"></p>
2116
</div>
2217
</div>
2318
</div>
2419
</body>
25-
</html>
20+
</html>

0 commit comments

Comments
 (0)