r/programminghorror • u/leo_gblr • Feb 18 '26
Client side login
Suggestion from a colleague. Might have offline login when using caching strategies. I don't know what a hash is.
481
Upvotes
r/programminghorror • u/leo_gblr • Feb 18 '26
Suggestion from a colleague. Might have offline login when using caching strategies. I don't know what a hash is.
219
u/DT-Sodium Feb 18 '26
When you say colleague, do you happen to mean some random drunk guy in the street?
310
u/AnywhereHorrorX Feb 18 '26
"Very secure", displaying user pass after logging in gives away that this is an obvious trolling.
179
u/LordTurson Feb 18 '26
There should seriously be a rule about not posting intentionally written bad code.
56
u/CMDR_ACE209 Feb 18 '26
Just denying access on the wrong input is too mean. You should give hints for the correct password in that case.
37
u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You live" Feb 18 '26
So this fetches all the users email addresses and passwords, then looks for a match in JavaScript all within the browser? Please for the love of Christ tell me this is a joke and not a thing that actually exists.
13
u/nuc540 Feb 18 '26
I’m more concerned that this code suggests your backend is storing passwords as raw strings, and haven’t been salted at all.
A hash isn’t a way to securely store a password, a hash is just a one-way mathematical transformation to change a value; salting one-ups this by adding extra data on top so it can’t simply be reverse solved.
You’ll need both salting and encryption for a secure authentication flow
28
u/ZioNickkk Feb 18 '26
Ai slop ahh code
3
u/CuriousConnect Feb 19 '26
Oooh, lovely. Sharing everyone’s passwords into the browser just to check if the input matches one of them. How handy.
2
u/MantisTobogganSr Feb 18 '26
“”””securely”””” logged lmfao
2
u/PJBthefirst Feb 18 '26
Didn't know that Tea's source code got leaked
2
u/FalseWait7 Feb 19 '26
"Your password has been securely logged" is the biggest lie this app does, and yet it is not the worst mistake it makes.
2
u/TorinNionel Feb 19 '26
This has to be rage bait, the user loaded confirmation even says “very secure“ in what appears to be a sarcastic tone.
2
u/JAXxXTheRipper Feb 19 '26
Oh come on, this is 100% larping.
2
u/Elegant_Body1607 Feb 19 '26
bruh dont tell me the colleague is checking for every possible combination of user in user db
2
u/WrappedStrings Feb 20 '26
Theres absolutely no way this is real. You had an LLM spit that out just for this post
3
u/Jussins Feb 18 '26
It’s secure. It says so in the code. They wouldn’t put a message in the code that is untrue. /s
1
u/Nvlist Feb 18 '26
One of my school colleagues did this then i showed the network tab
1
u/bistr-o-math Feb 18 '26
Looks legit. No passwords in code /s
1
u/maowtm Feb 18 '26
This is insecure op, you aren't even hashing the passwords
1
u/Cran_Burst Feb 19 '26
Anyone know the colorscheme?
1
u/6ood6host Feb 19 '26
😂 fr? Diz bad.
1
u/-VisualPlugin- Feb 19 '26
I actually saw a similar system from a company that had a booth at an electronics trade show in Anaheim.
I forgot the company, probably for a medical practice, but I asked to review their code right then and there.
I recall that it was a C# Windows program and that they had all the user 'credentials' in a client-sided database. The person I spoke with was not the one who wrote the program, so he couldn't answer me well.
1
u/GothGirlsGoodBoy Feb 19 '26
I’ve done client side login before.
It was just an admin panel on an internal tool. The one with the buttons to delete everything and whatnot.
Its more so people don’t accidentally click it than security against intentional malicious behaviour.
1
u/NamedBird Feb 19 '26
This is totally fine if you trust the frontend. :-)
(kiosk system within a trusted space where you only need a simple sanity check.)
1
u/Cylian91460 Feb 19 '26
Wtf is that comment?
It's literally the function name, that the most useless comment I have ever seen
1
u/eclipticdogeballs Feb 19 '26
As someone who is now learning full stack from backend, this is really instructive to show me how the HTML interacts with JS… and what not to do.
1
u/0EVIL9 Feb 23 '26
That's the shitty ai code style