Forráskód Böngészése

Polish hellojs Sample

- Apply timestamp to composed messages
- Remove unnecessary $.map call
- Add password encoder prefix to password

Fixes gh-8555
Fixes gh-8556
Josh Cummings 5 éve
szülő
commit
c519d726ed

+ 1 - 1
samples/javaconfig/hellojs/src/main/java/org/springframework/security/samples/config/SecurityConfig.java

@@ -28,7 +28,7 @@ public class SecurityConfig {
 			AuthenticationManagerBuilder auth) throws Exception {
 		auth
 			.inMemoryAuthentication()
-				.withUser("user").password("password").roles("USER");
+				.withUser("user").password("{noop}password").roles("USER");
 	}
 		// @formatter:on
 }

+ 2 - 0
samples/javaconfig/hellojs/src/main/java/org/springframework/security/samples/mvc/MessageJsonController.java

@@ -16,6 +16,7 @@
 package org.springframework.security.samples.mvc;
 
 import java.util.ArrayList;
+import java.util.Calendar;
 import java.util.List;
 import java.util.Optional;
 
@@ -67,6 +68,7 @@ public class MessageJsonController {
 			}
 			return new ResponseEntity<>(errors, HttpStatus.BAD_REQUEST);
 		}
+		message.setCreated(Calendar.getInstance());
 		message = messageRepository.save(message);
 		return new ResponseEntity<>(message, HttpStatus.OK);
 	}

+ 1 - 2
samples/javaconfig/hellojs/src/main/resources/resources/js/message.js

@@ -40,8 +40,7 @@ function MessageListViewModel() {
         $.ajax("./", {
             data: ko.toJSON(self.compose),
             type: "post", contentType: "application/json",
-            success: function(result) {
-                $.map(result, function(item) { return new Message(item) });
+            success: function() {
                 self.goToInbox();
             }
         });