-
limit login attempts
hi how do i change this code to limit user attempts to 3?
public void validateUser(String name, String password) {
if (name.equals("admin") && password.equals("letmein")) {
display.setCurrent(list1);
} else {
tryAgain();
}
}
public void tryAgain() {
Alert error = new Alert("Login Incorrect", "Please try again", null, AlertType.ERROR);
-
Hm, .... perhaps, give it a counter variable?
-
Kind of, usually what you can do is flag the user based on successful login. And on each login after that you've to validate.