use of com.tap5.hotelbooking.entities.User in project tapestry5-hotel-booking by ccordenier.
the class BasicAuthenticator method login.
public void login(String username, String password) throws AuthenticationException {
User user = crudService.findUniqueWithNamedQuery(User.BY_CREDENTIALS, QueryParameters.with("username", username).and("password", password).parameters());
if (user == null) {
throw new AuthenticationException("The user doesn't exist");
}
request.getSession(true).setAttribute(AUTH_TOKEN, user);
}
Aggregations