• 0 Posts
  • 49 Comments
Joined 1 year ago
cake
Cake day: October 13th, 2023

help-circle


  • I live in a deep red state. Not a swing state. Not a questionable state. A state where registered red voters outnumber blue voters 2-1.

    I’m not saying that this applies to everyone but even if blue had an excellent turnout including me and reds had a bad turnout, it would still be a red win with a ratio 3-2.

    I’m not voting not because I don’t care, not because I don’t think it’s the right thing to do, not for some moral high ground, but because it actually doesn’t matter. I am disenfranchised, I accept it, I make the best decisions I can knowing that.

    I’m sure some will still tell me I’m wrong but I’m going to focus on my own interests and mental health.

    If you are in a swing state, please vote. If not for yourself, for me. I’ll consider it a favor.

    (I have good reasons for living here. If you tell me I should move then why don’t you move to a swing state?)





  • In addition to the excellent points made by steventhedev and koper:

    user.password = await hashPassword(user.password);

    Just this one line of code alone is wrong.

    1. It’s unclear, but quite likely that the type has changed here. Even in a duck typed language this is hard to manage and often leads to bugs.
    2. Even without a type change, you shouldn’t reuse an object member like this. Dramatically better to have password and hashed_password so that they never get mixed up. If you don’t want the raw password available after this point, zero it out or delete it.
    3. All of these style considerations apply 4x as strongly when it’s a piece of code that’s important to the security of your service, which obviously hashing passwords is.