Modified code to reflect the code from the article

This commit is contained in:
Zeger Hendrikse 2016-12-20 22:44:47 +01:00
parent de2080f59f
commit 66e6ae6c19
1 changed files with 3 additions and 5 deletions

View File

@ -30,7 +30,7 @@ public class RegistrationController {
private static final Logger logger = LoggerFactory.getLogger(RegistrationController.class); private static final Logger logger = LoggerFactory.getLogger(RegistrationController.class);
@Autowired @Autowired
AuthenticationManager authenticationManager; private AuthenticationManager authenticationManager;
/** /**
* For demo purposes this need only be a GET request method * For demo purposes this need only be a GET request method
@ -49,8 +49,6 @@ public class RegistrationController {
String username = "user"; String username = "user";
String password = "password"; String password = "password";
String view = "registrationSuccess";
if (requestQualifiesForManualAuthentication()) { if (requestQualifiesForManualAuthentication()) {
try { try {
authenticate(username, password, request, response); authenticate(username, password, request, response);
@ -58,12 +56,12 @@ public class RegistrationController {
} catch (BadCredentialsException bce) { } catch (BadCredentialsException bce) {
logger.debug("Authentication failure: bad credentials"); logger.debug("Authentication failure: bad credentials");
bce.printStackTrace(); bce.printStackTrace();
view = "systemError"; // assume a low-level error, since the registration return "systemError"; // assume a low-level error, since the registration
// form would have been successfully validated // form would have been successfully validated
} }
} }
return view; return "registrationSuccess";
} }
private boolean requestQualifiesForManualAuthentication() { private boolean requestQualifiesForManualAuthentication() {