3 ms·
The correct action is to disable the button while the request is in flight so it can't be clicked a second time. Otherwise you won't see "user already logged in
by stavros 4mo ago
The correct action is to disable the button while the request is in flight so it can't be clicked a second time. Otherwise you won't see "user already logged in", because the user won't be logged in until the previous request returns (a race condition).
- LordDragonfang 4mo agoIf you have a race condition, "correct action" is to solve that, because you shouldn't be papering over server-side bugs with client-side Javascript (and yes, it's a bug, because I shouldn't see an error page if I press the back button after logging in (and trying to navigate to what I was doing before logging in) either, which I still see quite often)
- stavros 4mo agoHow would you solve this on the server?