private void login() throws UserException, NoSuchAlgorithmException, InvalidKeySpecException {
System.out.println("=== Log in ===");
while (true) {
System.out.println("Enter your login \nor Enter EXIT for return to main menu ->");
String inputLogin = this.sc.nextLine();
if ("EXIT".equalsIgnoreCase(inputLogin)) {
break;
}
try {
User user = userImpl.read(inputLogin);
if (user.getLogin() == null) {
System.err.println("Username incorrect.");
} else {
System.out.println("Enter your password \n or Enter EXIT for return to main menu ->");
String inputPassword = this.sc.nextLine();
user = userImpl.readPassword(inputPassword);
if (!user.getPassword().equals(generateStrongPasswordHash(inputPassword)) || "EXIT".equalsIgnoreCase(inputPassword)) {
System.err.println("Password incorrect");
continue;
}
System.out.println("Log in successfully✔✔✔");
}
} catch (UserException | NoSuchAlgorithmException | InvalidKeySpecException e) {
e.printStackTrace();
}
}
}
I'm trying to realise a console program Cinema with using JDBC (MySQL). After using the login method I get this Exception. How do I realise authorization on the console app? User User