Просмотр исходного кода

reactive/webflux/hello-security-explicit

Rob Winch 5 лет назад
Родитель
Сommit
a54a4c5c5f

+ 1 - 1
reactive/webflux/hello-security-explicit/src/main/java/example/SecurityConfiguration.java

@@ -42,7 +42,7 @@ public class SecurityConfiguration {
 			.authorizeExchange((exchanges) -> exchanges
 				.anyExchange().authenticated()
 			)
-			.httpBasic(withDefaults());
+			.formLogin(withDefaults());
 		// @formatter:on
 		return http.build();
 	}

+ 1 - 1
reactive/webflux/hello-security-explicit/src/main/resources/templates/index.html

@@ -4,6 +4,6 @@
 </head>
 <body>
     <h1>Hello Security</h1>
-    <a th:href="@{/logout}">Log Out</a>
+    <a id="logout" th:href="@{/logout}">Log Out</a>
 </body>
 </html>

+ 1 - 1
reactive/webflux/hello-security-explicit/src/test/java/example/HelloSecurityTests.java

@@ -40,7 +40,7 @@ public class HelloSecurityTests {
 		this.rest.get()
 			.uri("/")
 			.exchange()
-			.expectStatus().isUnauthorized();
+			.expectStatus().is3xxRedirection();
 		// @formatter:on
 	}