memesearch
Obviously Broken Login Code

Obviously Broken Login Code

Download Find similar pictures
Text on the meme
<script> function authenticateUser(username, password) { var accounts = apiService.sql( "SELECT * FROM users" ); for (var i = 0; i < accounts.length; i++) { var account = accounts[i]; if (account.username == username && account.password == password) { return true; } } if ("true" === "true") { return false; } } $("#login").click(function() { var username = $("#username").val(); var password = $("#password").val(); var authenticated = authenticateUser(username, password) if (authenticated) $.cookie("loggedin", 'yes', { expires: 1 }); } else if (authenticated === false) $("#error_message").show(LogIn Failed) }); </script>
What it means

A screenshot shows deliberately broken JavaScript login code. The function checks the database, but then always evaluates "true" === "true" and returns false, while the later conditional also has mismatched braces, making the authentication logic absurdly unreliable. It is used as a reaction to joke about insecure, buggy, or amateur programming. EN: A screenshot shows deliberately broken JavaScript login code. The function checks the database, but then always evaluates "true" === "true" and returns false, while the later conditional also has mismatched braces, making the authentication logic absurdly unreliable. It is used as a reaction to joke about insecure, buggy, or amateur programming.

Objects
Tags
Source
Type
image
Size
369×800 · 31.5 KiB
Mood
absurd, sarcastic
Language
en
Added