logoalt Hacker News

PunchyHamstertoday at 11:12 AM2 repliesview on HN

the correct action is not to debounce but instead of error page see user already logged in in previous request and continue


Replies

jonahxtoday at 4:32 PM

I think the better solution for a web page login form specifically is to disable the button "onPressDown", so this error path is impossible.

For users with JS disabled, your solution seems good.

stavrostoday at 6:29 PM

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).