mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-07-06 18:52:13 +00:00
Tidying.
This commit is contained in:
parent
2afccfc633
commit
e659e15f90
@ -1,7 +1,5 @@
|
|||||||
package samples.gae.users;
|
package samples.gae.users;
|
||||||
|
|
||||||
import com.google.appengine.api.datastore.EntityNotFoundException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Service used to maintain a list of users who are registered with the application.
|
* Service used to maintain a list of users who are registered with the application.
|
||||||
|
@ -38,7 +38,7 @@ public class GaeAppController {
|
|||||||
|
|
||||||
String logoutUrl = UserServiceFactory.getUserService().createLogoutURL("/loggedout.htm");
|
String logoutUrl = UserServiceFactory.getUserService().createLogoutURL("/loggedout.htm");
|
||||||
|
|
||||||
response.sendRedirect(logoutUrl);
|
response.sendRedirect(logoutUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/loggedout.htm", method= RequestMethod.GET)
|
@RequestMapping(value = "/loggedout.htm", method= RequestMethod.GET)
|
||||||
|
@ -34,11 +34,11 @@ public class RegistrationController {
|
|||||||
return new RegistrationForm();
|
return new RegistrationForm();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(method = RequestMethod.POST)
|
@RequestMapping(method = RequestMethod.POST)
|
||||||
public String register(@Valid RegistrationForm form, BindingResult result) {
|
public String register(@Valid RegistrationForm form, BindingResult result) {
|
||||||
if (result.hasErrors()) {
|
if (result.hasErrors()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||||
GaeUser currentUser = (GaeUser)authentication.getPrincipal();
|
GaeUser currentUser = (GaeUser)authentication.getPrincipal();
|
||||||
@ -56,6 +56,6 @@ public class RegistrationController {
|
|||||||
// Update the context with the full authentication
|
// Update the context with the full authentication
|
||||||
SecurityContextHolder.getContext().setAuthentication(new GaeUserAuthentication(user, authentication.getDetails()));
|
SecurityContextHolder.getContext().setAuthentication(new GaeUserAuthentication(user, authentication.getDetails()));
|
||||||
|
|
||||||
return "redirect:/home.htm";
|
return "redirect:/home.htm";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user