Polish hellojs Sample
- Apply timestamp to composed messages - Remove unnecessary $.map call - Add password encoder prefix to password Fixes gh-8555 Fixes gh-8556
This commit is contained in:
+1
-1
@@ -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
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user