Since the XSS incident a couple of weeks back, I hadn't been able to log in, or even sign up for a new account. All attempts at either ended with the spinning bear. Now, presumably because of the upgrade, I have been able to create a second account to post this, but I can't log in to my original account, AppelTrad, because it prompts for 2-factor authentication.
This is (partially) my own fault, I suppose, for clicking the checkbox and not mentioning that it didn't actually give me any of the promised results, while I was still logged in; since I was also able to untick the box without being prompted for anything, I just assumed it was a bit of not-yet-implemented UI and that I had reset the option for if it ever became effective, and carried on without any problems until the forced logout.
Since "2FA being broken is a known issue", I'm wondering: is it possible for an admin to reset that field in my database record (or whatever needs to be done to cancel 2FA) without any of the security shenanigans that should accompany working two-factor authentication, so I can successfully log in again? (I have my passwords saved, so it's not just a mistyped password issue.)
The rake has nothing to do with JS (which I agree is cursed, but for its own reasons, not this).
You have called a function in a way that does not give a consistent value (
Date()
). Such functions are hardly the preserve of JavaScript. You've failed to adequately deal with the range of values produced, with code that tries to insist that the "31st February" can be a meaningful date in February. You should accept that this is your mistake and learn to (better) avoid side effects where possible.Edit responding to your edit:
The
Date()
function's output varies according to something other than its input (and even the rest of your program). Using its output without accounting for that variation means that your function, as originally written, also gives inconsistent return values, varying according to something other than its input, because it does, in fact, reference something outside the function. If it did not, the results would only depend on themonthNumber
argument, and would always be consistent. I don't know what you call that, but I view it as a side effect.As you have said, the rake is that months have different lengths, and you need to account for that. But that's not one of JavaScript's many issues.