Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
02d85ae57c
@ -7,17 +7,30 @@ public class Credentials {
|
||||
|
||||
public Credentials(String login, String password) {
|
||||
this.hash = Helpers.getHash(password);
|
||||
System.out.println(hash);
|
||||
this.login = login;
|
||||
}
|
||||
|
||||
public boolean valid() {
|
||||
|
||||
boolean usernameGiven = false;
|
||||
String hashData;
|
||||
|
||||
//iterator over file
|
||||
for (String line:
|
||||
Helpers.readTextdatei("data/passwd.txt")) {
|
||||
System.out.println(line);
|
||||
if(login == line) {
|
||||
usernameGiven = true;
|
||||
continue;
|
||||
}
|
||||
if(usernameGiven && hash == line) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user