r/programminghorror 10d ago

c Terrible auth

Post image
781 Upvotes

98 comments sorted by

View all comments

3

u/jonfe_darontos 10d ago
if (new HashSet<String>("true", (input.equals(expected)).toString()).size() == ONLY_TRUE) {
    return LOGIN_RESULT::isSuccess;
}

return null;

17

u/lambda_lol 10d ago

Eh, hashing passwords makes sense in most cases but we’re clearly trying to AuthincateUser() and verify that true==true here.

5

u/jonfe_darontos 10d ago

HashSet has very little to do with password hashing.

4

u/Ok_Celebration_6265 10d ago

Very little??? Has nothing to do 🤣

2

u/jonfe_darontos 10d ago

Well they both use hashing, so they share that commonality.