Skip to main content

CodeSOD: Death of the Auth-Er

1 day 18 hours ago

When writing Perl, it's not unusual to want to die. The die function ends your Perl program with an error string, and you'll often see code like: die "My error" unless $i > 5 or die "Other error" if check(), because Perl just loves the backwards conditionals. What's even more fun with die is how it behaves with eval blocks, so it doesn't always kill your program, sometimes it is how you pass error strings back out of sections of your program.

And poor Bobby has inherited some Perl that just really loves to die.

public function store() { echo 'Hello'; die; if (Auth::attempt(Input::only('email', 'password'))) { echo 'done'; die; // return "welcome ".Auth::user()->username } echo "Oops! Fails"; die; return Redirect::back()->with_input(); }

Bobby didn't send the source control history here, but I have a sense of what it likely was like, once. If they authenticate successfully, print a welcome message. If they don't, redirect back to the logon page and let them try again. I suspect they wanted to disable the route. So first they disabled the success path, only to discover that the failure path kept redirecting, so they disabled that too. Finally, they added the Hello at the top to disable the whole thing.

Why? Why did they do any of this? No idea. It feels like debugging code, but you'd expect more echos and fewer dies if that were the case. And you wouldn't expect it to leak into production and sit there for years, which is what happened here.

.comment { border: none; } [Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!
Remy Porter

BYD Sold More EVs Last Month Than the US Did All Quarter

1 day 21 hours ago
An anonymous reader quotes a report from Electrek: The world's leading EV maker is showing no signs of slowing down. BYD sold 490,168 new energy vehicles (NEVs) in October, up 11% from the prior year and the company's highest monthly total in 2026. BYD's battery electric vehicles drove the growth, with a record 305,743 units sold, up 37% year over year and marking the first time its EV sales have crossed the 300,000 mark. To put that into perspective, just over 262,500 EVs were sold in the US in the entire third quarter combined, according to Kelley Blue Book estimates. By the end of the year, BYD expects overseas shipments to reach about 2 million vehicles. "In 2027, that number is expected to rise to more than 2.5 million vehicles," adds Electrek.

Read more of this story at Slashdot.

BeauHD