top | item 42024362

(no title)

sebastialonso | 1 year ago

Can't believe the answers you're getting. The answer's a big fat NO. If you find yourself in that situation, there's something very incorrect with your design.

discuss

order

magicalhippo|1 year ago

So how would you design it instead?

its-summertime|1 year ago

    key = anyhash(uuid+username)
    if (result := cache.get(uuid+username)):
        if hash_and_equality(password, result.password_hash):
            return result.the_other_stuff
    # try login or else fail