Skip to content

Instantly share code, notes, and snippets.

@rlazoti
Last active December 13, 2015 21:48
Show Gist options
  • Save rlazoti/4979532 to your computer and use it in GitHub Desktop.
Save rlazoti/4979532 to your computer and use it in GitHub Desktop.
Exemplo de controller do vraptor usando vraptor-authentication.
@Resource
public class AuthenticationController {
private AuthenticationControl authenticationControl;
public AuthenticationController(AuthenticationControl authenticationControl) {
this.authenticationControl = authenticationControl;
}
@Login
@Get("/login")
public void login() {
}
@Post("/signin")
public void signin(final User user) {
//validate the user information
authenticationControl.createSession(user);
}
@Get("/signout")
public void signout() {
authenticationControl.destroySession();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment