Last active
December 13, 2015 21:48
-
-
Save rlazoti/4979532 to your computer and use it in GitHub Desktop.
Exemplo de controller do vraptor usando vraptor-authentication.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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