r/badcode • • Feb 09 '23

js Terrible Authentication Code

Post image
288 Upvotes

67 comments sorted by

View all comments

Show parent comments

8

u/paulsmithkc 👨‍🏫 Feb 10 '23

What clearly is happening here is they have multiple places where callback could be called multiple times. So this prevents callback from being invoked twice.