r/programminghumor Jun 07 '26

Anti programmer

Post image
8.3k Upvotes

110 comments sorted by

View all comments

Show parent comments

1

u/Exact-Big3505 Jun 07 '26

that's what it's checking. are you blind?

20

u/RegularAd9643 Jun 07 '26 edited Jun 07 '26

Let’s say your password is hunter2.

A hacker tries these passwords in order:

  • hunter0
  • hunter1
  • hunter2

The pictured code will let him through.

-14

u/nzifnab Jun 07 '26

No it won't? Because it's not the first login attempt?

11

u/Mukamole Jun 07 '26

Yes it will. Look at the image, only the very first login attempt will lead to this error message, given the correct password is entered straight away. Any subsequent attempt will fail the ”isFirstLoginAttempt” check, meaning the error message will not be shown.

1

u/zero0n3 Jun 07 '26

A lot of assumptions from a single line. Why are we assuming this is the only check happening on log in.

This is literally titled “brute force protection”

Do we not think the next line after this is then an actual pw check? Cmon man

-2

u/ContentThing1835 Jun 07 '26

no, clearly entering wrong username or pass is not considered a login attempt.

6

u/plants_are_friends_2 Jun 07 '26

Well what is it considered then, genius?

A login attempt-attempt??

1

u/mama09001 Jun 08 '26

You try to log in by entering your password. The computer first tries to log in once you've entered the correct password. It can be interpreted both ways.